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.

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
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
Thanks. It was definitely the missing RewriteLock directive. –  Yonatan Broza Jul 1 '11 at 18:03
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.