httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karim Zaki <>
Subject [users@httpd] Environment variable problem with mod_rewrite and mod_headers
Date Mon, 06 Apr 2009 16:20:09 GMT
Hi all,

I¹m experiencing a strange issue with mod_rewrite and mod_headers.
Basically, what I¹m doing is setting an environment variable using
mod_rewrite and trying to use the value of that variable to set a header in
the request using mod_headers.


RewriteCond             %{HTTP:TEST-HEADER}                  ([0-9]+)
RewriteRule             .*      -       [E=TEST_VAR:%1]

RequestHeader           set     ANOTHER-HEADER          %{TEST_VAR}e

I know that the RewriteCond is being matched, and that the variable is being
set. I see it in the rewrite log. However, the header doesn¹t seem to be set
properly because this rule does not match:

RewriteCond     %{HTTP:ANOTHER-HEADER}      ^\d+$

This last rule comes after the RequestHeader is set. I¹m using Apache 2.0,
but I¹m frankly not sure what the exact version is.

Does anyone know what could be the cause of this behavior? I¹ve stumbled
upon another thread where someone was  complaining of not being able to read
environment variables set by mod_rewrite through mod_headers, and that he
was able to read the variable when he used SetEnv instead of mod_rewrite to
set the value.

Any help is appreciated.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message