Re: [users@httpd] rewritemap help?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/15/05, Chris Knipe <savage@xxxxxxxxxxxxx> wrote:
> RewriteEngine On
> RewriteMap MyMap txt:the.file
> 
> 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.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux