Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 27468 invoked from network); 6 Sep 2006 13:26:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Sep 2006 13:26:05 -0000 Received: (qmail 14351 invoked by uid 500); 6 Sep 2006 13:25:57 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 13384 invoked by uid 500); 6 Sep 2006 13:25:55 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 13373 invoked by uid 99); 6 Sep 2006 13:25:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 06:25:55 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jslive@gmail.com designates 66.249.82.238 as permitted sender) Received: from [66.249.82.238] (HELO wx-out-0506.google.com) (66.249.82.238) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 06:25:54 -0700 Received: by wx-out-0506.google.com with SMTP id s19so2710156wxc for ; Wed, 06 Sep 2006 06:25:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=CCFwaMJMqiUg1+ofpOf4JbOGaODuekOuNYzeSGAAglzWwEBHcSkJ44ryVsI9TDhw4IGgZFTnlEc2nwdcRxPasH15Jrc7bjwM7pfmX2ik0fmKJqYVOVqhh+b/d5iMwAYFrh14vWsXmHw79E4f1rVuRAUYZgr48IspTSZ6gukAfZA= Received: by 10.70.99.11 with SMTP id w11mr12071615wxb; Wed, 06 Sep 2006 06:25:33 -0700 (PDT) Received: by 10.70.45.4 with HTTP; Wed, 6 Sep 2006 06:25:33 -0700 (PDT) Message-ID: Date: Wed, 6 Sep 2006 09:25:33 -0400 From: "Joshua Slive" Sender: jslive@gmail.com To: users@httpd.apache.org In-Reply-To: <44FE8896.705@khine.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44FE8896.705@khine.net> X-Google-Sender-Auth: 1a2a7a16611d65a6 X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Dynamic RewriteRule based on the URL X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 9/6/06, Norman Khine 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 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