Operating System - HP-UX
1820693 Members
2706 Online
109627 Solutions
New Discussion юеВ

Apache mod_rewrite.log interpretation

 
Leon A. Howorth
Advisor

Apache mod_rewrite.log interpretation

Can someone point me to documentation that
explains the terminology used in the Apache
mod_rewrite log. I'm testing Rewrite rules
with log level 9 set, and I get plenty of output
in the mod_rewrite.log, but I don't quite understand all of it. For example, terms such as "pass through".

4 REPLIES 4
Elena Leontieva
Esteemed Contributor

Re: Apache mod_rewrite.log interpretation

Leon A. Howorth
Advisor

Re: Apache mod_rewrite.log interpretation

Thanks for the link to that guide, however it
does not contain information specific to the
mod_rewrite.log terminology.
Elena Leontieva
Esteemed Contributor

Re: Apache mod_rewrite.log interpretation

'passthrough|PT' (pass through to next handler)
This flag forces the rewriting engine to set the uri field of the internal request_rec structure to the value of the filename field. This flag is just a hack to be able to post-process the output of RewriteRule directives by Alias, ScriptAlias, Redirect, etc. directives from other URI-to-filename translators. A trivial example to show the semantics: If you want to rewrite /abc to /def via the rewriting engine of mod_rewrite and then /def to /ghi with mod_alias:
RewriteRule ^/abc(.*) /def$1 [PT]
Alias /def /ghi

If you omit the PT flag then mod_rewrite will do its job fine, i.e., it rewrites uri=/abc/... to filename=/def/... as a full API-compliant URI-to-filename translator should do. Then mod_alias comes and tries to do a URI-to-filename transition which will not work.
Note: You have to use this flag if you want to intermix directives of different modules which contain URL-to-filename translators. The typical example is the use of mod_alias and mod_rewrite..

Note - For Apache hackers:
If the current Apache API had a filename-to-filename hook additionally to the URI-to-filename hook then we wouldn't need this flag! But without such a hook this flag is the only solution. The Apache Group has discussed this problem and will add such a hook in Apache version 2.0.
Bill Douglass
Esteemed Contributor

Re: Apache mod_rewrite.log interpretation

I've attached the source code for the function that writes out to the log file in mod_rewrite.

The section at line 3517 specifically specifies what fields are being output to the log, and in what order.