我对 mod_rewrite 有两个主要问题:
-
当我的规则无效时,不会报告任何有意义的错误
-
To reliably test each modification, I have to erase Google Chrome's cache. This isn't rocket science, but I have to hit Ctrl + Shift + Delete, click OK, and close the window, and reload.
我想看看是否有任何专家愿意分享他们有效管理 mod_rewrite 代码的秘密。
一个技巧是打开重写日志。要打开它,请在 Apache HTTP Server 主配置或当前虚拟主机文件中尝试此行(not in .htaccess
):
LogLevel alert rewrite:trace6
阿帕奇之前httpd 2.4 mod_rewrite http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#logging,这样的每模块日志配置还不存在。相反,您可以使用以下日志记录设置:
RewriteEngine On
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 3
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)