Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 87831 invoked from network); 2 Jul 2007 12:41:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 12:41:06 -0000 Received: (qmail 77213 invoked by uid 500); 2 Jul 2007 12:40:46 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 77195 invoked by uid 500); 2 Jul 2007 12:40:46 -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 77174 invoked by uid 99); 2 Jul 2007 12:40:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 05:40:46 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of noodlet@gmail.com designates 66.249.82.232 as permitted sender) Received: from [66.249.82.232] (HELO wx-out-0506.google.com) (66.249.82.232) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 05:40:43 -0700 Received: by wx-out-0506.google.com with SMTP id h27so1243028wxd for ; Mon, 02 Jul 2007 05:40:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fl8vweAoUxw6d9iEhPJwLxUzHtgeDjdYnMafQDVW+svS3VBvr6IMWJ+2KY1Tu6XNyb7U6rR2FxEOmbPtEx3HndbMechK0jI5qsoGWiChG0NpVtEBA1FqhNVAPI9n2n1ilMR4CdGlbGbUYPESbUclV92Nqk+rMv5K/EZjtOFao/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=W9Ai7fKYDriQZpsNADimNKpiuEN3I8I7RloEo8vcRU4ya0QSLgjz/krQ7Xi6wiLp95hr8G0z9RzXQWUOygj3oLYV/0NVpDujUg+IOuaAEs+T28crhLVM+6vbXv5DxRD8gdJXuTu7uBOKUDGIYazSdrVdMPn4/lpv4iYcUdVsQX4= Received: by 10.70.84.6 with SMTP id h6mr5267528wxb.1183380021999; Mon, 02 Jul 2007 05:40:21 -0700 (PDT) Received: by 10.70.112.5 with HTTP; Mon, 2 Jul 2007 05:40:21 -0700 (PDT) Message-ID: <813716b60707020540x10d84977if56966b4ec7ab3bb@mail.gmail.com> Date: Mon, 2 Jul 2007 19:40:21 +0700 From: "Vincent Bray" To: users@httpd.apache.org In-Reply-To: <8a0832a10707020458g6bb3b04dt16dc9f4680293f85@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8a0832a10707020252l4cd87c9fl67e6ecf2fcb5250e@mail.gmail.com> <813716b60707020323y59551af8xf5f434104af68acb@mail.gmail.com> <8a0832a10707020458g6bb3b04dt16dc9f4680293f85@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Access parameters in URL On 02/07/07, Madonesa sanjaya wrote: > I have configured apache as a reverse proxy. Then for a particular url > , I need to add some headers to the request. At the moment I'm doing it > statically using the following configuration in httpd.conf file. > ProxyPass /care http://localhost:8080/test-care > ProxyPassReverse /care http://localhost:8080/test-care > > > RequestHeader add h1 "test1" > RequestHeader add h2 "test2" > RequestHeader add h3 "test3" > > > At the moment it is working fine.But I need to change the headers > dynamically. I need to send the header values as URL parameters and need to > set the three headers based on the the paramerters in the URL. Is there any > way to do it without using script? I'm still not exactly sure what you are asking for. From your use of RequestHeader, I'm assuming that the headers you want to manipulate are for the benefit of the service runnin on port 8080 to which you are proxying? If that is the case, and you want to set headers for the backend based on the URL, why not just get the backend to interpret the url? I'm not at all sure if this will work, but you could try something like: RewriteEngine On RewriteCond %{QUERY_STRING} foo=(.+) RewriteRule ^/care(/.*) http://localhost:8080/test-care$1 [E:some_env=%1] RequestHeader add X-h1 "test1" env=some_env Generally speaking you can't directly alter headers with mod_rewrite, but again I don't see why you have to. -- noodl --------------------------------------------------------------------- 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