2010-07-30 117 views
1

我有一个服务器有3个域都指向它。所有的域名都在同一个网站上。.htaccess域名重定向

www.domain1.com 
www.domain2.com 
www.domain3.com 

如何使用.htaccess将www.domain3.com重定向到www.domain3.com/test.html?

谢谢!

+0

所有三个域共享相同的网站?或者他们在不同的网站? – Rippo 2010-07-30 18:30:09

+0

是的,在同一个网站上。我正在使用wordpress亩。 – steamboy 2010-07-30 18:38:47

回答

6

在你的.htaccess,把:

RewriteEngine On 
RewriteCond %{http_host} ^www\.domain3\.com [NC] 
RewriteRule ^(.*)$ http://www.domain3.com/test.html [R=301,NC] 

应该这样做。

1

在你domain3的的.htaccess,把:

RedirectPermanent/http://www.domain2.com/test.html 
+0

非常感谢。但我错了我的问题。请参阅编辑版本。谢谢! – steamboy 2010-07-30 18:39:48