最近,我将我的 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 下,LocationHTTP 响应标头是/otherurl/someaction- 一个相对路径 URL。
但在 Apache 2.2.24 上,Location标头是http://www.example.com/otherurl/someaction- 完整的绝对 URL。
对这个问题有任何想法吗?