好的,我发现了一些与非常相似的问题有关的线程,但是使用为我自己的网站提供的答案没有任何运气。基本上我有 2 个站点,映射如下:
/public_html/ - points to main domain (www.site1.com)
/public_html/site2.com - points to secondary domain (www.site2.com)
/public_html/portal - points to my target subdirectory
我正在尝试获取对 www.site2.com/portal 的所有请求以透明地加载 www.site1.com/portal,也就是说,我仍然希望 www.site2.com/portal 显示在地址栏中。
RewriteCond %{HTTP_HOST} ^(www\.)?site2\.com [NC]
RewriteCond %{REQUEST_URI} ^/portal/(.*)$
RewriteRule ^/(.*) /portal/$1 [L]
根本不起作用
RewriteCond %{HTTP_HOST} ^(www\.)?site2\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/portal/(.*)$
RewriteRule ^(.*)$ http://site1.com/portal/$1 [L]
带我到http://site1.com/portal/site2.com/portal。
这几天我一直在用头撞墙,任何帮助将不胜感激!