Redirecting domain names to the same domain?

Go To StackoverFlow.com

0

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]
2012-04-03 20:11
by gijs007


0

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

2012-04-04 19:38
by gijs007


0

Try:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?haloservers\.net [NC]
RewriteRule ^(.*)\.html$ http://haloservers.us/$1 [R=301,L]
2012-04-03 20:39
by Firoz Ansari
I tried it like but it didn't work, it would just send me to www.xgclan.com Even when the htaccesses file in that folder was set to do the above.

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