httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Knipe" <>
Subject Re: [users@httpd] rewritemap help?
Date Tue, 16 Aug 2005 08:22:21 GMT
>> RewriteCond %{HTTP_HOST} ^${MyMap:%{HTTP_HOST}}$
>> RewriteRule ^(.{MyMap:%{HTTP_HOST}})$  <something here that is the value 
>> of
>> the key>$1 [P]
>> Basically, anything to host 1, proxy to host 2..... The main reason 
>> wanting
>> to use a external map, is so that we can add/remove/modify mappings on 
>> the
>> fly without having to restart apache....
>Try something like
>RewriteCond ${MyMap:%{HTTP_HOST}|not-found} !=not-found
>RewriteRule (.*) http://${MyMap:%{HTTP_HOST}}$1
>And be sure to use the RewriteLog to help you debug.

Morning.  Unfortunately, no luck :(

The config as it stands now:
RewriteEngine On
RewriteLog <log file>
RewriteLogLevel 9
RewriteMap MyMap txt:<file>
RewriteConf ${MyMap:%{HTTP_HOST}|not-found} !=not-found
RewriteRule (.*)$ http://${MyMap:%{HTTP_HOST}}$1 [P]

My map, contains:

Going to, the request ends up on my default v-host, which is 
configured after the Rewrite section.  My RewriteLog, shows nudda... Blank. 
I've added the [P] as Apache MUST proxy these requests... The is not accessable for any machines on the Internet, 
only the apache servers doing the rewriting, hence, it must proxy, and not 
show the browser the internal URLs etc.

Doing the above on a 'per vhost' config works very well (we have that 
running already), but we now obviously wants to move to a map in order to 
not having to restart / reconfigure new vhosts all the time in Apache....


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message