httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rando Christensen <>
Subject RE: [users@httpd] Location matching
Date Tue, 04 May 2004 21:24:32 GMT
On Tue, 4 May 2004 10:13:56 -0400, Cox, Charlie wrote: 
>>>  <LocationMatch [negative match]>
>>>     Do condition A
>>>  </LocationMatch>
>>>  Do condition B
>>  Couldn't you do this instead?:
>>>  <LocationMatch [positive match]>
>>>    Do condition B
>>>  </LocationMatch>
>>>  Do condition A
> This is what the alternative is. However with over 100 positive matches, a
> slew of LocationMatches is not real easy to maintain. It would be much
> easier to list the exclusions. The other thing is that new positive matches
> are added somewhat often and a negative match would not require the conf
> file to be changed (requiring a restart).

Well, that /is/ still listing the exclustions. Let's say for example 
that this is what you want to do, even though we've established that it 
doesn't work (and, for the sake of argument, let's say that the 
exclusion is, if it's "aaa", "bbb", or "ccc", you want to redirect them 

<LocationMatch !"/(aaa|bbb|ccc)">
  # Page is not aaa, bbb, or ccc. Redirect to some website.
# All is good. Display what they asked for.

Instead of that, you could do this:

<LocationMatch "/(aaa|bbb|ccc)">
  # All is good. Display what they asked for.
# Page is not aaa, bbb, or ccc. Redirect to some website.

You're still technically matching for the same thing, you're just 
inverting it differently. Think of it like this in a programming 

if (condition) { do_something(); }
else { do_something_else(); }

In comparison to this:

if (!condition) { do_something_else(); }
else { do_something(); }

< Rando Christensen | >

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