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.com/file/index.htm ===> http://www.mysite/file/index.htm when it is IP xxx.xxx.xxx.xxx

If not IP xxx.xxx.xxx.xxx then ===> http://www.mysite/index.htm
Shucar
 
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.
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Content

Who is online

Users browsing this forum: No registered users and 0 guests

cron