Author Options:

How can I restrict visitors to certain areas of a website based on IP address? Answered

I want to create two directories on a website: one is only accessible from certain IP addresses, and the other one available to everyone except those IP addresses. I think that the .htaccess mod_rewrite would work best, but how should I do it?


. You're on the right track. This should help.

Thanks. I forgot to mention that I want it to automatically redirect, but that can be done easily in PHP with a if...else statement and the IP variable.