.htaccess redirect to subdomain not working

依然范特西╮ 提交于 2019-12-25 12:50:06

问题


I have following code in my .htaccess file located in root of site.com:

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?site\.com$
RewriteRule ^files(.*)$ http://files.site.com/$1 [L,R=301,QSA]

I want to redirect site.com/files/path?query to files.site.com/path?query, but for some reason it won't work. Can someone tell me why?

来源:https://stackoverflow.com/questions/23716128/htaccess-redirect-to-subdomain-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!