I was wondering how to create and debug this kind of script that can become a bit of headache if you are not used to write them (like me).
Do you use tool to create them?
Any tips to debug what's going on instead of just create a local structure and see what's happening in the browser?
Note to readers: the old answer doesn't work anymore.
As of version 2.4, Apache no longer allows the RewriteLogLevel
and RewriteLog
directives. Now they're all bundled with the single LogLevel
directive (see Log Files documentation), which supports module-specific log levels with prefixes and trace[1-8]
constants. To set the highest level of logging specifically for the rewrite module, you now use the following:
LogLevel warn rewrite:trace8
You can set RewriteLog directive in your virtualhost configuration
It will write necessary info to the file specified by you.
RewriteLog "/usr/local/var/apache/logs/rewrite.log"
Further, use RewriteLogLevel directive to control the amount of logging
RewriteLogLevel 3
read through