301 .htaccess redirect subdomain to domain
RewriteCond %{HTTP_HOST} www.subdomain.example.com$ [NC]
RewriteRule (.*) http://subdomain.example.com/ [R=301,L]
To view this, you need to install the Flash Player 7. Please go to here and download it.
Monday, November 23rd, 2009
301 .htaccess redirect subdomain to domain
RewriteCond %{HTTP_HOST} www.subdomain.example.com$ [NC]
RewriteRule (.*) http://subdomain.example.com/ [R=301,L]
Wednesday, May 20th, 2009
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]