I want to redirect the following domain names :haloservers.net,haloservers.nl and servers.xgclan.com to the domain name www.haloservers.us I tried putting the code below in the htaccesses file but this didn't work.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.?)haloservers.net$
RewriteRule ^(.*)$ http://www.haloservers.us/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.?)haloservers.nl$
RewriteRule ^(.*)$ http://www.haloservers.us/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(servers\.)xgclan.com$
RewriteRule ^(.*)$ http://www.haloservers.us/$1 [R=301,L]
The following code fixed the problem.
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(.*)haloservers(.nl|.net)$
RewriteRule ^(.*) http://www.haloservers.us/$1 [L,R=301]
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?haloservers(.nl|.net) [NC]
RewriteRule ^(.*)\.html$ http://haloservers.us/$1 [R=301,L]
I got my solution from col-dejong @ http://gathering.tweakers.net/forum/list_messages/1497390/last
Try:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?haloservers\.net [NC]
RewriteRule ^(.*)\.html$ http://haloservers.us/$1 [R=301,L]
I also tried the following, but without succes: RewriteEngine On RewriteCond %{HTTPHOST} ^(www.)?haloservers.net [NC] RewriteRule ^(.*).html$ haloservers.us/$1 [R=301,L] RewriteCond %{HTTPHOST} ^(www.)?haloservers.nl [NC] RewriteRule ^(.).html$ haloservers.us/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^(servers.)?xgclan.com [NC] RewriteRule ^(.).html$ haloservers.us/$1 [R=301,L - gijs007 2012-04-03 21:30