我有我的主要url(www.example1.com),我想将我的停放域名(www.example2.com)redirect到我的主域名,但在根URL后面继续任何内容。
所以我想www.example2.com/homeredirect到www.example1.com/home和www.example2.com/about到www.example1.com/about等…
我尝试使用通配符redirect,但没有奏效。
任何帮助表示赞赏。
RewriteCond %{HTTP_HOST} ^example1\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.example1\.com$ RewriteRule ^(.*)$ http://example2.com/$1 [R=301,L]
你也可以在Apache的example1.com域中
Redirect permanent / http://domain2.com/
你真的需要redirect一个域到另一个?
如果两个域都必须加载相同的源代码,则可以使用ServerAlias(Apache)或主机头(IIS),并且只有一个网站具有多个域名侦听,所有域都必须指向同一个Web服务器。
让我知道,我会协助你如何做到这一点。