httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rando Christensen <e...@illuzionz.org>
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 
elsewhere):

<LocationMatch !"/(aaa|bbb|ccc)">
  # Page is not aaa, bbb, or ccc. Redirect to some website.
</LocationMatch>
# 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.
</LocationMatch>
# 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 
language:

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

In comparison to this:

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

--
< Rando Christensen | eyez@illuzionz.org >

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message