rewrite map (prg:) never finishes

Posted by SooDesuNe on Server Fault See other posts from Server Fault or by SooDesuNe
Published on 2010-12-31T19:53:25Z Indexed on 2010/12/31 20:56 UTC
Read the original article Hit count: 219

Filed under:
|

using Apache and a prg type rewrite map. My map looks like:

#!/usr/bin/perl
$| = 1; # Turn off buffering 
while (<STDIN>) {
    print "someothersite.com";
}

the rewrite rule declared in httpd.conf is:

RewriteMap app_map prg:/file/path/test.pl
RewriteRule  (\/[\w]+)(\/[^\#\s]+)?$ http://${app_map:$1}$2 [P,L]

And the log files show:

init rewrite engine with requested uri /a/testlink.html
applying pattern '(\/[\w]+)(\/[^\#\s]+)?$' to uri '/a/testlink.html'

It appears like test.pl is never giving control back to apache, when the map is successfully found I expect to see this output in the log file:

map lookup OK: map=app_map key=/a -> val=someothersite.com

Why is my map not returning control back to apache?

© Server Fault or respective owner

Related posts about apache

Related posts about mod-rewrite