【问题标题】:stop apache injecting it's own 404 not found page to the custom 404 error page停止 apache 将它自己的 404 not found 页面注入到自定义 404 错误页面
【发布时间】:2011-01-01 23:29:58
【问题描述】:

我在实现自定义 404 错误页面时遇到问题。我的设置是前端 apache 2.2.6 代理请求,而不是对后端应用服务器的静态文件(apache 1.3.36)

当用户向后端服务器请求一个不存在的页面时,我将 404 标头连同错误页面一起返回。我确实得到了错误页面,但是后端 apache 服务器也以某种方式在错误页面中注入了自己的 404 not found 页面。

这是 apache 注入到未找到页面的内容:

Not Found
The requested URL /product/8jd4776 was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.36 Server at www.example.com Port 8888 

知道为什么会这样吗?

【问题讨论】:

    标签: apache http-status-code-404


    【解决方案1】:

    在前端apache服务器中使用ErrorDocument设置“ProxyErrorOverride On”解决问题。

    【讨论】:

      【解决方案2】:

      自定义 404 消息的内容长度必须为 512 字节或更多。

      【讨论】:

        猜你喜欢
        • 2014-01-26
        • 2019-12-16
        • 1970-01-01
        • 2015-08-01
        • 2016-04-25
        • 2013-09-16
        • 1970-01-01
        • 1970-01-01
        • 2015-03-18
        相关资源
        最近更新 更多