this code will redirect all ips other then the one you set to “another-page.php” via 302 redirect
the only ip allowed will be your, which is 25.35.45.55 in this case
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^25\.35\.45\.55
RewriteCond %{REQUEST_URI} !/main\.htm$
RewriteRule .* http://www.domain.com/old/main.htm [R=302,L]
redirect only index page and leave everything else as is:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$
RewriteCond %{REQUEST_URI} !/index\.htm$
RewriteRule \.(php|s?html?)$ http://subdomain.something.com [R=302,L]
Related posts:
This entry was posted on Wednesday, May 20th, 2009 at 11:51 pm and is filed under htaccess .