【发布时间】:2013-08-20 01:11:04
【问题描述】:
我的理解是,要显示自定义错误页面,必须放
ErrorDocument 404 /error/404.php
在 .htaccess 中
还有,
AllowOverride All
必须在 httpd.conf 文件中设置。但是,现在它设置为
AllowOverride None
如果我将 None 更改为 All,然后重新启动服务器,当我故意在地址栏中输入乱码时会收到 Internal Server Error 500。我做错了什么?
文件中的其他内容
IndexIgnore *
紧随其后
RewriteEngine on
遵循重写规则。
RewriteEngine on 是问题的原因——见下文。
【问题讨论】:
-
您的 htaccess 文件中还有其他内容吗?
-
在服务器的错误日志中查看确切的错误信息。
-
所以我发现了错误日志:
[Sat Aug 17 17:33:46 2013] [alert] [client 127.0.0.1] C:/Data/MyWeb/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration我猜这是我在新 PC 上设置 Apache 时开始的,直到现在才注意到问题。该脚本以前有效。 -
@Gary 请删除您的问题或发送答案并标记它!
-
答案是保证
LoadModule rewrite_module modules/mod_rewrite.so在httpd.conf中没有注释
标签: apache .htaccess http-status-code-404 errordocument