From 8460e53ca0f4cd6686931a45be44d775283dbecd Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Tue, 22 Jan 2019 09:42:28 +0000 Subject: [PATCH] Copy the "Note about /" note from the Location explanation to the LocationMatch explanation. Probably more people use LocationMatch than Location with "~". CTR: docs Backport of r1851790 from trunk. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1851792 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/core.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index c0580edc780..fc664116727 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -3173,6 +3173,28 @@ matching URLs Require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example </LocationMatch> + + Note about / (slash) +

The slash character has special meaning depending on where in a + URL it appears. People may be used to its behavior in the filesystem + where multiple adjacent slashes are frequently collapsed to a single + slash (i.e., /home///foo is the same as + /home/foo). In URL-space this is not necessarily true. + The LocationMatch + directive and the regex version of Location require you to explicitly specify multiple + slashes if that is your intention.

+ +

For example, <LocationMatch "^/abc"> would match + the request URL /abc but not the request URL + //abc. The (non-regex) Location directive behaves similarly when used for + proxy requests. But when (non-regex) Location is used for non-proxy requests it will + implicitly match multiple slashes with a single slash. For example, + if you specify <Location "/abc/def"> and the + request is to /abc//def then it will match.

+
How <Directory>, <Location> -- 2.47.3