Re: [users@httpd] Dynamic RewriteRule based on the URL

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

 



On 9/6/06, Norman Khine <norman@xxxxxxxxx> 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@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