Apache RewriteCond (subdomain)

北城余情 提交于 2019-12-10 10:14:40

问题


I am trying to redirect request for a subdomain to main domain. ie: xxx.domain.com/blah/xyz --> domain.com/blah/xyz

My rewriteconds work fine for xxx.domain.com but for anything like xxx.domain.com/123/xyz 400 Bad Request is all I get…

Any help will be appreciated.


回答1:


Rule should look like :

RewriteCond %{HTTP_HOST} ^xxx.domain.com
RewriteRule (.*) http://domain.com/$1 [L]


来源:https://stackoverflow.com/questions/5641715/apache-rewritecond-subdomain

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