如何调试Apache的mod_rewrite [英] How to debug Apache mod_rewrite

查看:165
本文介绍了如何调试Apache的mod_rewrite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有mod_rewrite的两个主要问题:

I have two main problems with mod_rewrite:

1)当我有一个无效的规则没有报告有意义的错误

1) There is no meaningful error reported when I have an invalid rule

2)为了可靠地测试每个修改,我不得不删除Chrome的高速缓存。这不是火箭科学,但我不得不按Ctrl + Shift + Delete键然后点击确定,然后关闭窗口,并重新载入。

2) To reliably test each modification, I have to erase chrome's cache. This isn't rocket science, but I have to hit Ctrl+Shift+Delete then click OK, then close the window, and reload.

我想看看是否有任何大师都愿意分享他们的秘密,高效管理的mod_rewrite code。

I'd like to see if any of the gurus are willing to share their secrets to efficiently managing mod_rewrite code.

推荐答案

一个技巧是打开改写日志。要打开它,尝试在你的Apache主配置或当前虚拟主机文件这些行(不可以的.htaccess

One trick is to turn on the rewrite log. To turn it on,try these lines in your apache main config or current virtual host file (not in .htaccess):

RewriteEngine On
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 3

因为Apache httpd的2.4 mod_rewrite的 RewriteLog和RewriteLogLevel指令已被完全取代新的每个模块的日志记录配置。

Since Apache httpd 2.4 mod_rewrite RewriteLog and RewriteLogLevel directives has been completely replaced by the new per-module logging configuration.

LogLevel alert rewrite:trace6

这篇关于如何调试Apache的mod_rewrite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆