Debug Rewrite Rule In Apache


Sometimes we need to test rewrite rule and log to see what happen, just put this on .htaccess file

RewriteLog /tmp/rewritelog
RewriteLogLevel 9

RewriteLog directive set the path to the log file. you can also set this directive to send log to a program. For a bit more complete information about this see here

valid values for RewriteLogLevel is 0-9

0 = no logging at all
9 = logging all possible information

see here for more complete explanation

don’t forget to turn on the RewriteEngine by putting this line

RewriteEngine on

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s