【问题标题】:Apache RewriteCond (subdomain)Apache RewriteCond(子域)
【发布时间】:2011-08-04 05:52:34
【问题描述】:

我正在尝试将子域的请求重定向到主域。 即:xxx.domain.com/blah/xyz --> domain.com/blah/xyz

我的 rewriteconds 对 xxx.domain.com 工作得很好,但对于像 xxx.domain.com/123/xyz 这样的任何事情,我得到的只是 400 Bad Request……

任何帮助将不胜感激。

【问题讨论】:

  • 你现在使用什么规则?

标签: apache mod-rewrite subdomain


【解决方案1】:

规则应该是这样的:

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

【讨论】:

    猜你喜欢
    • 2012-02-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多