httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Proniewski Patrick <patrick.proniew...@univ-lyon2.fr>
Subject Re: [users@httpd] negative regex in SetEnvIf
Date Fri, 09 Jun 2006 12:50:13 GMT
On 9 juin 06, at 14:32, Joshua Slive wrote:

>> # will not work...
>> BrowserMatch !Firefox not_fx
>
> There is no direct support for this, but you can often reverse the
> logic and cause the regex to unset and env variable instead and then
> use the lack of the variable as a trigger for whatever you were trying
> to do.

Yes, we've explored this a little bit yesterday with the syntax:

SetEnvIf Request_URI .* GoAway=1
BrowserMatch .+ !GoAway
SetEnvIf Referer .+ !GoAway
Deny from env=GoAway

that means "deny every client that comes with blank user-agent AND  
with blank referer" (do no deny every client that comes either with a  
non-blank client, or with a non-blank referer)

It's easy, because ".+" is the negation of "^$", so I don't have to  
use something like "!^$" (which wouldn't work)
I think it's becoming more complicated if I want the opposite of a  
particular value.

for example: "deny every client that comes with Firefox AND with  
blank referer" (do no deny every client that comes either with a non- 
firefox client, or with a non-blank referer)

may be I'm missing something obvious...

Patrick PRONIEWSKI
-- 
Administrateur Système - SENTIER - Université Lumière Lyon 2


Mime
View raw message