【发布时间】:2013-10-17 19:10:53
【问题描述】:
最近,我将我的 Apache 服务器从 2.0 升级到 2.2.24,但我遇到了 RedirectMatch 的问题。
我的旧RedirectMatch 指令:
RedirectMatch ^/abc/abcd /otherurl/someaction
在 Apache 2.0 中,如果我们使用 HTTPS 访问,例如。 https://www.example.com/abc/abcd,它将重定向到https://www.example.com/otherurl/someaction。
但在 apache 2.2.24 中,它返回 http://www.example.com/otherurl/someaction(HTTP,而不是 HTTPS)——看来 Apache 已经更改了请求架构。
如果我通过 http watch 检查 HTTP 响应,我发现 2.0 和 2.2.24 之间存在差异。
在 Apache 2.0 下,Location HTTP 响应标头是 /otherurl/someaction - 一个相对路径 URL。
但在 Apache 2.2.24 上,Location 标头是 http://www.example.com/otherurl/someaction - 完整的绝对 URL。
对这个问题有什么想法吗?
【问题讨论】:
-
您能否在
RedirectMatch周围添加您的整个配置?如果我理解您的问题是正确的,您在进行重定向时会错过 SSL 部分吗? -
可能是您的
https站点未在Apache 2.2 中启用,从而使http站点成为默认站点?
标签: apache http-redirect mod-alias