This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
请注意,在较新的 Apache 版本上,
RewriteLog
和RewriteLogLevel
已被删除,事实上现在在尝试启动 Apache 时会触发错误(至少在我的 XAMPP 安装中)阿帕奇2.4.2):相反,您现在应该使用通用
LogLevel
指令,级别为trace1< /code> 到
trace8
。 “调试”没有在日志中为我显示任何重写消息。示例:
LogLevel warn rewrite:trace3
对于官方文档,
当然这也意味着现在你的重写日志将被写入通用错误日志文件中,你必须自己整理它们。
Do note that on newer Apache versions the
RewriteLog
andRewriteLogLevel
have been removed, and in fact will now trigger an error when trying to start Apache (at least on my XAMPP installation with Apache 2.4.2):Instead, you're now supposed to use the general
LogLevel
directive, with a level oftrace1
up totrace8
. 'debug' didn't display any rewrite messages in the log for me.Example:
LogLevel warn rewrite:trace3
For the official documentation, see here.
Of course this also means that now your rewrite logs will be written in the general error log file and you'll have to sort them out yourself.
编辑:请注意,这个答案已经有 10 多年历史了。对于较新版本的 Apache,请参阅 sp00n 的回答。将此答案留给旧版本 apache 的用户。
对于旧版本 Apache:
为了调试 mod_rewrite 问题,您需要使用 RewriteLogLevel 和 RewriteLog:
Edit: note that this answer is 10+ years old. For newer versions of Apache, please see the answer by sp00n. Leaving this answer for users of older versions of apache.
For older version Apache:
For debugging mod_rewrite issues, you'll want to use RewriteLogLevel and RewriteLog:
您需要在较新版本中对您的
httpd.conf
使用LogLevel rewrite:trace3
http://httpd.apache.org/docs/2.4/mod/mod_rewrite .html#logging
You need to use
LogLevel rewrite:trace3
to yourhttpd.conf
in newer versionhttp://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#logging