httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn <>
Subject [users@httpd] Trouble with regexp on <Directory>, using Apache 1.3.33
Date Wed, 24 Aug 2005 21:18:38 GMT
Hello everyone,

I've been trying to solve this for the last 2 days, but somehow I'm unable 
to see the logic here. Hope anyone can help me explain what's going on:

I've got a few directories, lets say they're named A, B, C and D.
Two of these (A and B) need to be restricted.

I figured that this should be done by the following regexp:
<Directory ~ "/home/websites/(A|B)">

To my knowledge, this should match /home/websites/A or /home/websites/B .
Instead, Apache matches everything in /home/websites and blocks access to C 
and D as well.

Strange, since a very similar regexp is shown in the apache 1.3 documentation:

I also tried using (A|B)/? and several ways of matching the start and end 
of the string using ^ and $ , but to no effect.

In an attempt to isolate the problem, I tried something else:
<Directory ~ "(/home/websites/A|/home/websites/B)">
But strangely, this DOES match A but NOT B, so now I'm confused.
I've checked the path and I'm sure there are no mistakes there.

If I'm not using a regexp, eg. <Directory "/home/websites/A"> (or B), 
everything works like it should, so my guess would be that the contents of 
the directory-directive are right, only the regexp is the problem.

What am I missing here?

Thanks in advance,

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