Jul 19, 2002 #1 robdon Programmer May 21, 2001 252 ES Hi, I know how to block a certain IP, with .htaccess and I also know how to redirect pages. How can I redirect all attempts to access my site to another site... Based on an IP address. Is this possible? A line in .htaccess? Thanks, Rob Donovan.
Hi, I know how to block a certain IP, with .htaccess and I also know how to redirect pages. How can I redirect all attempts to access my site to another site... Based on an IP address. Is this possible? A line in .htaccess? Thanks, Rob Donovan.
Jul 19, 2002 #2 sleipnir214 Programmer May 6, 2002 15,350 US It can be done. You'll need to use mod_rewrite to do it. Something along the lines of: RewriteEngine on RewriteCond %{REMOTE_ADDR} <match IP> RewriteRule .* http://newsite [R] Will issue a redirect to anyone matching <match IP> to the site of your choice. Check http://httpd.apache.org/docs/mod/mod_rewrite.html for more information. ______________________________________________________________________ Never forget that we are made of the stuff of stars Upvote 0 Downvote
It can be done. You'll need to use mod_rewrite to do it. Something along the lines of: RewriteEngine on RewriteCond %{REMOTE_ADDR} <match IP> RewriteRule .* http://newsite [R] Will issue a redirect to anyone matching <match IP> to the site of your choice. Check http://httpd.apache.org/docs/mod/mod_rewrite.html for more information. ______________________________________________________________________ Never forget that we are made of the stuff of stars