2014-01-18 31 views
1

我试图让子域使用htaccess的我的网站的工作,例如:子域MOD-重写问题内部重定向不起作用

shopping.site.local应该引导用户去site.local /购物的并且保持初始子域格式的方式,意味着在用户不能注意到的内部重定向中。

我已经添加下面的脚本:

RewriteCond %{HTTP_HOST} ^shopping.site.local$ [OR] 
RewriteCond %{HTTP_HOST} ^www.shopping.site.local$ 
RewriteRule ^(.*)$ http://www.site.local/shopping-and-fashion/$1 [L] 

重定向发生成功,但在外部的方式,如何隐藏重定向到所要的网址:

http://shopping.site.local

和内容:

http://www.site.local/shopping-and-fashion

回答

0

你试过用[P]代替[L]吗?

+0

是的,给了我一个错误! ;) –

0

下使用反向代理,应该给你想要的

<VirtualHost *:80> 
    ServerName shopping.site.local 
    ProxyPass/http://www.site.local/shopping-and-fashion/ nocanon 
    ProxyPassReverse/http://www.site.local/shopping-and-fashion/ 
</VirtualHost> 

您可能需要破解一些JS和CSS,以适应如果原始文件不友善相对链接的路径改变什么。