httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <m...@catseye.org>
Subject Re: [users@httpd] Mod-ReWrite
Date Sat, 24 Sep 2011 20:25:08 GMT
On September 24, 2011 16:06 , Suneet Shah <suneetshah2000@gmail.com> wrote:
> I have the following url:
> http://localhost/test_rpc/header.jsp?tkn=abc
>
> In my httpd.conf I added the following:
>
> RewriteEngine on
> Options +FollowSymLinks
>
> RewriteCond %{QUERY_STRING} tkn=(.*)
> RewriteRule ^/test_rpc/$ [E=var1:%1]
> RequestHeader append tkn var1
>
> In my test, the Header "tkn" shows up with a value of "var1", instead 
> of "abc" which is on the query string.


The RequestHeader directive you currently have means "append the literal 
string 'var1' to the value of the header named 'tkn'"; this is why you 
are seeing the above result in your test.  The RequestHeader directive 
does not know that you want it to interpret 'var1' as the name of an 
environment variable, because you have not told it to do so.

In order to append the value of the environment variable named 'var1' to 
the header named 'tkn', try

RequestHeader append tkn %{var1}e

For more information, see

https://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader
https://httpd.apache.org/docs/2.2/mod/mod_headers.html#header

--
   Mark Montague
   mark@catseye.org


---------------------------------------------------------------------
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