【发布时间】:2015-04-03 09:18:47
【问题描述】:
我有 2 个网站:
www.test1.com
和
www.test2.com
使用下面的代码,我可以从 test1.com 重定向到 test2.com 而无需更改 url
RewriteEngine On
RewriteCond %{HTTP_HOST} ^test1.com
RewriteRule ^(.*) http://test2.com/$1 [P]
但如果我尝试访问 test1 中的文件夹,例如 test1.com/folder,它也会重定向。 那么我如何只能重定向根文件夹但仍然不更改 url 但能够访问我的主域中的子文件夹?
【问题讨论】: