You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Kogelheide, Ryan SSBC:EX" <Ry...@gov.bc.ca> on 2011/06/03 23:45:26 UTC
[users@httpd] SetEnvIf and mod_rewrite
Hi everyone,
I need your help. I've been trying to check a header variable provided by top-level filter and proxy depending on it:
SetEnvIf SERVERSESSIONID ".+" AUTHENTICATED
RewriteCond %{ENV:AUTHENTICATED} 1
RewriteRule ^/(.*) https://backend:7792/authenticated/$1 [P,L]
ProxyPassReverse / https:// backend:7792/authenticated/
RewriteCond %{ENV:AUTHENTICATED} !1
RewriteRule ^/(.*) https:// backend:7792/unauthenticated/$1 [P,L]
ProxyPassReverse / https:// backend:7792/unauthenticated/
But it's like mod_rewrite can't see the variable (in the rewrite log):
applying pattern '^/(.*)' to uri '/'
RewriteCond: input='' pattern='1' => not-matched
applying pattern '^/(.*)' to uri '/'
RewriteCond: input='' pattern='!1' => matched
I saw one post
http://turboflash.wordpress.com/2010/05/27/apache-environment-variables-visibility-with-setenv-setenvif-and-rewriterule-directives/
that said that sometimes variables aren't visible, but I don't really understand why. I think I'm missing something fundamental about how the httpd works.
I'm using Apache 2.0.64 and the directives are in a virtual host.
Cheers,
Ryan