httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
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 <norman@khine.net> wrote:
>
> Thanks for your reply, I was looking at the
> http://httpd.apache.org/docs/2.2/misc/rewriteguide.html 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.

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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message