Freek Dijkstra wrote:

> Curious,
>  is never matched
>  is matched.
> Logically, I would have expected both regexps to yield the same result.

I did some more testing, and it just seems that the the end of line
anchor is just never matched. I can easily reproduce it with only a few
configuration lines (see below).

Is this a (known) bug or is there another explanation why I'm seeing
this behaviour? If this is intended behaviour, what configuration is
required to get the intended behaviour?


Steps to reproduce
1. Add the following configuration to httpd.conf:

Alias /test/ /var/www/test/


    Options Indexes
    Order deny,allow
    Deny from all



    Allow from all



Expected results:
- requesting http://localhost/test/projects would give an autoindex
- requesting http://localhost/test/projects/subdir would give a 403
Forbidden

Actual results:
- requesting http://localhost/test/projects gives a 403 Forbidden
- requesting http://localhost/test/projects/subdir gives a 403 Forbidden

Regression:
1.
The following DirectoryMatch (without trailing /) gives the same result:

    Allow from all


2.
Adding an Allow from all for a specific subdirectory works as expected
(requesting the directory shows an autoindex):

    Allow from all


3.

    Allow from all

results in 403 Forbidden for all requests. The DirectoryMatch is never
matched.

4.

    Allow from all

results in autoindexes for all requests. The DirectoryMatch is always
matched, as expected.

5.
The regular expressions
"^/var/www/test/projects/.*$"
"^/var/www/test/projects/.*"
are logically the same. However Apache clearly treats them differently
(see 3 and 4 above). This seems like a bug to me.

6. Replacing the Directory directives with corresponding Location
directives gives the same result.


Notes:
1. Tested with Apache 2.2.9 on Linux, Apache 2.2.14 on Mac OS X and
Apache 2.2.15 on Mac OS X.
2. The note at
http://stackoverflow.com/questions/1665210/apache-config-exclude-subdirectories
indicates other people encounter this problem too. ("For some reason my
apache on Fedora 8 seems to be ignoring the end of line anchor in the
regular expression").

---------------------------------------------------------------------
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-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to