2012-04-03 112 views
0

我想重定向以下域名:haloservers.net,haloservers.nl和servers.xgclan.com到域名www.haloservers.us 我試着把下面的代碼放在htaccesses文件中,但這並沒有工作。將域名重定向到同一個域名?

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] 

回答

0

下面的代碼固定的問題。

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] 

我得到了我從COL-dejong @http://gathering.tweakers.net/forum/list_messages/1497390/last

0

嘗試:

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^(www\.)?haloservers\.net [NC] 
RewriteRule ^(.*)\.html$ http://haloservers.us/$1 [R=301,L] 
+0

解決方案,我試過喜歡,但它沒有工作,它只是送我去www.xgclan.com 即使htaccesses在該文件文件夾被設置爲執行上述操作。 我也嘗試了以下,但沒有成功: RewriteEngine On RewriteCond%{HTTP_HOST} ^(www \。)?haloservers \ .net [NC] RewriteRule ^(。*)\。html $ haloservers.us/$1 [ R = 301,L] RewriteCond%{HTTP_HOST} ^(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:01