Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do you troubleshoot Apache redirects in production? I know there's a logging feature somewhere that lets you log all the redirects that happen...

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

To log what's going on in the mod_rewrite module you need to set RewriteLog and RewriteLogLevel:

RewriteLog         /path/to/mod_rewrite.log
RewriteLogLevel    2

in your Apache config (you can't set them in your .htaccess).

Note that logging has changed in Apache 2.4.

share|improve this answer
    
This will not work if they are actual Redirects and not RewriteRules. –  Vinko Vrsalovic May 22 '09 at 18:00
    
Very true, I was making the assumption that he was using mod_rewrite :) –  Nathan May 22 '09 at 20:09
add comment

I generally create my own verbose CustomLog. In it, I include the HTTP Response header Location

I also include other things such as the response time and HTTP Request header X-Forwarded-For, amongst a select other few things.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.