SetEnvIf and mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
 

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux