httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Freek Dijkstra <>
Subject Re: [users@httpd] allow autoindex for a directory, but not for its subdirectories
Date Mon, 23 Aug 2010 09:02:34 GMT
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

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

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

    Allow from all

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

    Allow from all


    Allow from all

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


    Allow from all

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

The regular expressions
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.

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
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:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message