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