httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <>
Subject Re: [users@httpd] Dynamic RewriteRule based on the URL
Date Wed, 06 Sep 2006 13:25:33 GMT
On 9/6/06, Norman Khine <> wrote:
> Thanks for your reply, I was looking at the
> documentation
> and perhaps something like this may work...
> RewriteEngine on
> RewriteCond   %{*HTTP_HOST*}                 *[^.]+*\.host\.com$
> RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
> RewriteRule   *([^.]+)*\.host\.com(.*) http://localhost:9080/*$1*$2 [P]
> RequestHeader set X-Base-Path %{*HTTP_HOST*}
> #Not sure if the logs entry is correct
> ErrorLog       /var/log/apache2/%{*HTTP_HOST*}-error_log
> CustomLog      /var/log/apache2/%{*HTTP_HOST*}-access_log common

The mod_rewrite stuff seems close, although there a bunch of random
"*"s thrown around that shouldn't be there.  But you can't use
mod_rewrite variables (like %{HTTP_HOST}) in non-mod_rewrite
directives.  For example, ErrorLog and CustomLog cannot use variables
like that, and I'm not sure if RequestHeader support env variables.


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