How to See the Rewrite action ?

New to mod_rewrite? This is a good place to start.

Postby Darren » Wed Jul 03, 2002 2:41 pm

Is there a way to make mod_rewrite print out to the console the URL rewrite changes being done in every rewrite rule ? This will help a great deal in learning how rewrite directive works and allow one to debug things. Thanks.
Darren
 
Posts: 2
Joined: Tue Jul 02, 2002 4:00 pm

Postby Darren » Wed Jul 03, 2002 4:04 pm

I found the answer to my own question.
You can turn on mod_rewrite logs and depending on loglevel it can log all the rewrite rule actions.

Create a logfile "myrewrite.log" in your apache logs directory. Add these lines right before your Rewrite rule:

RewriteEngine on
RewriteLog "/usr/local/apache/logs/myrewrite.log"
RewriteLogLevel 9

it's explained in mode_rewrite reference documentation:
http://apache.rcbowen.com/httpd-docs-1. ... RewriteLog
Darren
 
Posts: 2
Joined: Tue Jul 02, 2002 4:00 pm

Postby Brett » Sun Aug 18, 2002 3:34 pm

Yep ... but, unfortunately the RewriteLog directive cannot be used in an .htaccess file.

That's Apache's rule, not mine! :wink:
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 25 guests

cron