Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Nov 2008 17:33:45 +1100 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        questions@freebsd.org
Subject:   Apache environment variables - logical AND
Message-ID:  <20081105170631.O70117@sola.nimnet.asn.au>

next in thread | raw e-mail | index | archive | help
I know this isn't FreeBSD specific - but I am, so crave your indulgence.

Running Apache 1.3.27, using a fairly extensive access.conf to beat off 
the most rapacious robots and such, using mostly BrowserMatch[NoCase] 
and SetEnvIf to moderate access to several virtual hosts.  No problem.

OR conditions are of course straighforward:

  SetEnvIf <condition1> somevar
  SetEnvIf <condition2> somevar
  SetEnvIf <exception1> !somevar

What I can't figure out is how to set a variable3 if and only if both 
variable1 AND variable2 are set.  Eg:

  SetEnvIf Referer "^$" no_referer
  SetEnvIf User-Agent "^$" no_browser

I want the equivalent for this (invalid and totally fanciful) match: 

  SetEnvIf (no_browser AND no_referer) go_away

Any clues?

cheers, Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081105170631.O70117>