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]
4

2 回答 2

0

尝试:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?haloservers\.net [NC]
RewriteRule ^(.*)\.html$ http://haloservers.us/$1 [R=301,L]
于 2012-04-03T20:39:18.677 回答
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得到了我的解决方案

于 2012-04-04T19:38:19.890 回答