Apache Error指令忽略ErrorDocument指令

时间:2013-11-20 02:04:13

标签: apache error-handling

我在 .htaccess 上写了 if 以检查是否安装了* mod_rewrite *并抛出错误 500 ,如果没有。

ErrorDocument 500 /500.html

<IfModule !mod_rewrite.c>
    Error "mod_rewrite not installed"
</IfModule>

如果我收到 500 错误,则会显示 500 .html。但如果它从 Error 指令获得相同的错误,它将显示默认的错误页面。为什么?我该如何解决?

1 个答案:

答案 0 :(得分:0)

好吧,经过深思熟虑并稍微阅读后,我相信Error函数只会让.htaccess解析为取消 - 和要记录的错误 - 然后从 apache config 中抛出 500错误 之前已解析 例如,来自另一个文件夹 over 此文件夹中的.htaccess或来自apache的httpd.conf

相关问题