【发布时间】:2011-10-16 22:42:03
【问题描述】:
这是我正在使用的重写规则:
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} !^(www.)secure.\ [NC]
RewriteRule (.*) https://secure.%{HTTP_HOST}%{REQUEST_URI} [R,L]
如果端口是 443(SSL 端口)并且请求的域不以 secure 或 www.secure 开头,则应该应用此规则。
相反,它会重定向到 secure.secure,然后返回 404 错误。或者,如果我从创建重写规则中删除安全
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} !^(www.)secure.\ [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
我收到了太多重定向错误。
我承认,我不是 mod_rewrite 专家,但我认为自己能够通过参考文档来发挥作用。然而,在这一点上,我很难过。谢谢!
【问题讨论】:
-
乔希,欢迎来到 SO。如果你在这里没有得到好的答案,你可以试试 serverfault.com。
-
好的,谢谢。但是,我有信心破坏堆栈!
标签: apache mod-rewrite redirect ssl subdomain