1

I use the following configuration:

RewriteEngine On
RewriteMap url-rewrite prg:/usr/bin/url-rewrite
RewriteRule ^(.*)$ ${url-rewrite:%{HTTP_HOST}$1} [P]

But sometimes the rewritten URLs get mixed up:

127.0.0.1 - - [30/Jun/2011:15:12:37 +0300]   
[localhost...] [...] (5) map lookup OK:
map=url-rewrite key=localhost/1.gif ->
val=http://127.0.0.1:8080/path/2.gif

The url-rewrite script only adds the path segment but doesn't change the name of the file. I expected val=http://127.0.0.1:8080/path/1.gif. This causes the user to actually get the wrong image file.

Note: If you want to get detailed debug log like the above (with performance implications) use:

RewriteLog /path/to/file.log
RewriteLogLevel 9
0

1 Answer 1

2

Seems the url-rewrite script is getting wrong, you should post this script code.

But before that check that you've set the RewriteLock Directive, when using a prg: apache needs a synchronisation lock, not to mix results.

1
  • Thanks. It was definitely the missing RewriteLock directive. Jul 1, 2011 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .