【问题标题】:ErrorDocument 404 just shows "404"ErrorDocument 404 只显示“404”
【发布时间】:2011-05-05 07:01:05
【问题描述】:

我已经设置了我的 .htaccess 并进行了一些重写,尽管当我转到已经设置了 ErrorDocument 404 的无效目录时,它只在页面上显示“404”,没有别的,只是一个纯文本使用“404”。

RewriteEngine on

RewriteBase /
RewriteRule ^404/?$ 404.php

ErrorDocument 404 404

为什么不显示404页面,如果我去404.phphttp://www.mydomain.com/404显示很好,为什么不显示页面?

【问题讨论】:

    标签: php .htaccess http-status-code-404


    【解决方案1】:

    您需要重新格式化您的 .htaccess,请参阅: http://www.javascriptkit.com/howto/htaccess2.shtml

    正确的行是:

    ErrorDocument 404 /errors/notfound.html
    

    【讨论】:

      猜你喜欢
      • 2012-08-25
      • 2012-12-17
      • 1970-01-01
      • 1970-01-01
      • 2013-11-07
      • 1970-01-01
      • 2013-01-04
      • 2018-03-24
      • 2021-06-10
      相关资源
      最近更新 更多