Restricting access to file

Using mod_rewrite to handle various content issues

Restricting access to file

Postby Shucar » Tue May 25, 2004 4:58 pm

How can I use mrw to redirect all users except ones I allow.

eg. ===> http://www.mysite/file/index.htm when it is IP

If not IP then ===> http://www.mysite/index.htm
Posts: 2
Joined: Tue May 25, 2004 4:53 pm

Postby Caterham » Sun Jan 02, 2005 9:07 am

If you are still interested (for .htaccess):

Code: Select all
RewriteCond %{REMOTE_ADDR} !^180\.232\.168\.32
RewriteRule ^file /index.htm [R,L]

If the remote address does not match and /file/ is requested, an external redirect to index.htm would take place.
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Return to Content

Who is online

Users browsing this forum: No registered users and 1 guest