How to debug Apache mod_rewrite

后端 未结 5 1300
不思量自难忘°
不思量自难忘° 2020-11-22 04:56

I have two main problems with mod_rewrite:

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

5条回答
  •  渐次进展
    2020-11-22 05:33

    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
    

    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
    

提交回复
热议问题