阿帕奇的RewriteCond(子) [英] Apache RewriteCond (subdomain)
本文介绍了阿帕奇的RewriteCond(子)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图重定向一个子域的主域名的请求。
即: xxx.domain.com/blah/xyz
- > domain.com/blah/xyz
I am trying to redirect request for a subdomain to main domain.
ie: xxx.domain.com/blah/xyz
--> domain.com/blah/xyz
我rewriteconds工作的优良 xxx.domain.com
,但对于像 xxx.domain.com/123/xyz $ C $什么C>的 400错误的请求的是我得到的...
My rewriteconds work fine for xxx.domain.com
but for anything like xxx.domain.com/123/xyz
400 Bad Request is all I get…
任何帮助将AP preciated。
Any help will be appreciated.
推荐答案
规则应该是这样的:
RewriteCond %{HTTP_HOST} ^xxx.domain.com
RewriteRule (.*) http://domain.com/$1 [L]
这篇关于阿帕奇的RewriteCond(子)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文