httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandeep Warikoo" <>
Subject [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
Date Tue, 17 Oct 2006 11:17:40 GMT
Hi All,

I am facing a very strange problem with mod_rewrite module of Apache.
I am using an external program in perl to perform key-value mapping using
RewriteMap Directive.

I have a very simple program:


$i = 1;

while($input = <STDIN>)
    print "$i\n";

And the RewriteRule is

RewriteLock /root/
RewriteMap cvssvnrev    prg:/root/

RewriteCond %{QUERY_STRING}    ^rev=(.*)$
RewriteRule /viewcvs/viewcvs.cgi/(.*)$1?rev=${cvssvnrev:$1+%1} [L]

This means that for first access to such url I should get "rev=1", for next
access "rev=2", and so on as query String. But

what I get is "rev=" for first access, "rev=1" for second access, "rev=2"
for third access, i.e. the value I get is the one that was

calculated during previous execution. It looks like the apache module after
writing to STDIN of this program doesn't wait for

newline termination output from program (which it should so as per
specification), but immediately reads whatever is on pipe

which is nothing for first execution, and output of previous executions for
rest of executions.

Is this a bug in mod_rewrite module (I am using Apache version 2.2)? Or
there is some option I have missed?


View raw message