166Views3Replies

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?

Discussions

0
None
NachoMahma

Best Answer 9 years ago

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

0
None
MePersonNachoMahma

Answer 9 years ago

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.