Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E966D95FB for ; Wed, 21 Sep 2011 05:20:40 +0000 (UTC) Received: (qmail 1431 invoked by uid 500); 21 Sep 2011 05:20:37 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 1403 invoked by uid 500); 21 Sep 2011 05:20:37 -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 1368 invoked by uid 99); 21 Sep 2011 05:20:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Sep 2011 05:20:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of icicimov@gmail.com designates 209.85.210.173 as permitted sender) Received: from [209.85.210.173] (HELO mail-iy0-f173.google.com) (209.85.210.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Sep 2011 05:20:28 +0000 Received: by iagf6 with SMTP id f6so2033558iag.18 for ; Tue, 20 Sep 2011 22:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=OlLpSPm/Tf+H5ZUI8A0+UP3Js8elEgPnbka7CclTes8=; b=AvikA0gb477Xb6pN8vi+oy/hwxo5fUhhoQr/K96+oYzGOK6UaiVKGsO6ltfttqMQuD uSBUhW23MNpseSBpKD4fD0usixD6bl7t6k2ZQZwD6Z+r8TU6JnskPUAL9OQQ23pbu0M1 +t5EGKK2Lyh0R8xroaeeEz5lO7ib7Hn3OO7rg= MIME-Version: 1.0 Received: by 10.231.68.144 with SMTP id v16mr621099ibi.27.1316582407387; Tue, 20 Sep 2011 22:20:07 -0700 (PDT) Received: by 10.231.3.136 with HTTP; Tue, 20 Sep 2011 22:20:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 21 Sep 2011 15:20:07 +1000 Message-ID: From: Igor Cicimov To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=00151773e634b5bba704ad6cba32 X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Mod-Proxy and Mod-Headers --00151773e634b5bba704ad6cba32 Content-Type: text/plain; charset=ISO-8859-1 Hi mate, Try something like this for the example you gave http://host/myapp?userid=abc&role=myrole: RewriteEngine on Options +FollowSymLinks RewriteCond QUERY_STRING userid=(.*)&role=(.*) RewriteRule ^/myapp$ [E=var1:%1,var2:%2] RequestHeader append userid var1 RequestHeader append role var2 This is untested and not sure about the correct syntax in the [E=var1:%1,var2:%2] flag, ie do you need coma or ; between the vars etc, but thats the general idea. Cheers, Igor On Wed, Sep 21, 2011 at 8:51 AM, Suneet Shah wrote: > Thanks Igor. > > Would you be able to point me to an example? I dont fully understand how I > can configure this to take a parameter of the query string and then set a > variable as a header. > > thanks for your help > > > > On Tue, Sep 20, 2011 at 6:29 PM, Igor Cicimov wrote: > >> Use mod_rewrite to set variable and then set that var as header. >> On Sep 21, 2011 7:32 AM, "Suneet Shah" >> wrote: >> > Hello, >> > >> > I had a question about Mod-Proxy and Mod_headers >> > >> > 1) Is it possible to take a values that are on a query string and pass >> them >> > as headers? If so how? >> > For example, if I have: >> > >> > http://host/myap?userid=abc&role=myrole >> > I would like to take the values in the query string and pass them as >> headers >> > to the app that I am proying to >> > >> > 2) I would like to pass the above headers or query string parameters on >> > every request. >> > How can I do this? Is there a way to put these values in session have >> have >> > them passed as headers every time? >> > >> > If there is a better appraoch for the above, please let me know. >> > >> > thanks in advance for your help >> > suneet >> > > --00151773e634b5bba704ad6cba32 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi mate,
=A0
Try something like this for the example you gave http://host/myapp?userid=3Dabc&= role=3Dmyrole:
=A0
RewriteEngine on
Options +FollowSymLinks
RewriteCond QUERY_STRING userid=3D(.*)&role=3D(.*)
RewriteRule = ^/myapp$ [E=3Dvar1:%1,var2:%2]

RequestHeader append userid var1
RequestHeader append role var2=
=A0
This is untested and not sure about the correct syntax in the [E=3Dvar= 1:%1,var2:%2] flag, ie do you need coma or ; between the vars etc, but that= s the general idea.
=A0
Cheers,
Igor
On Wed, Sep 21, 2011 at 8:51 AM, Suneet Shah <suneetshah20= 00@gmail.com> wrote:
Thanks Igor.

Would you be= able to point me to an example? I dont fully understand how I can configur= e this to take a parameter of the query string and then set a variable as a= header.

thanks for your help=20



On Tue, Sep 20, 2011 at 6:29 PM, Igor Cicimov <icicimov@gmail.com> wrote:

Use mod_rewrite to set variable and then set that var as header.

On Sep 21, 2011 7:32 AM, "Suneet Shah"= <suneetsh= ah2000@gmail.com> wrote:
> Hello,
>=
> I had a question about Mod-Proxy and Mod_headers
>
> 1) I= s it possible to take a values that are on a query string and pass them
= > as headers? If so how?
> For example, if I have:
>
> http://host/myap?userid=3Dabc&role=3Dmyrole
> I would= like to take the values in the query string and pass them as headers
&g= t; to the app that I am proying to
>
> 2) I would like to pass the above headers or query string par= ameters on
> every request.
> How can I do this? Is there a way= to put these values in session have have
> them passed as headers ev= ery time?
>
> If there is a better appraoch for the above, please let me kn= ow.
>
> thanks in advance for your help
> suneet


--00151773e634b5bba704ad6cba32--