Mailing List Archive

[Bug 65057] ambiguities in <DirectoryMatch>
https://bz.apache.org/bugzilla/show_bug.cgi?id=65057

--- Comment #1 from Christoph Anton Mitterer <calestyo@scientia.net> ---
I've tested (3) with mod_dir disabled and it seems Apache does the following:


1) there is no automatic anchoring to ^ or $ if the regexp doesn't contain them
so e.g. "^/var/www" would also match /var/www/foo/ and /var/wwwbar/
(admittedly I only tested for $,... and was too lazy for ^ ... some developer
please confirm)


2) The path, is taken from the URI, but multiple consecutive / are merged i.e.
/var///www/ becomes /var/www/ .

(which is btw. also missing from the documentation)


3) From the URL given, which is then take as the path relative to the
DocumentDir, there is no implicit addition or removal of a trailing /
(if mod_dir is not enabled).

That means if my regexp is like these (and DocumentRoot = /):
-"^/var/www/$"
it matches http://example.org/var/www/ but not http://example.org/var/www
-"^/var/www$"
it matches http://example.org/var/www but not http://example.org/var/www/

Neither of those two would match subdirs or appended stuff like /var/wwwbar

One should tell people to either use mod_dir and make sure their regexps have
the trailing / ... or if they don't want to use something like:
-"^/var/www/?$"
which would match again both URLs, with and without trailing /



Guess these three points would be valuable to the documentation.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
[Bug 65057] ambiguities in <DirectoryMatch> [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=65057

--- Comment #2 from Christoph Anton Mitterer <calestyo@scientia.net> ---
Last but not least... the solution from Bug 32635 is still/again wrong (either
the regexp, or the description).

"^/www/.*/[0-9]{3}" is not anchored to $, so not only will it also match e.g.
/www/333aaa but also /www/333/and/even/more .


Cheers,
Chris.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org