From: Richard Bowen Date: Tue, 14 Apr 2015 18:39:15 +0000 (+0000) Subject: Clarifies FilesMatch and LocationMatch examples, as per bz53483 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33d2803060aa821ee29dec4898a1ef489f84be9f;p=thirdparty%2Fapache%2Fhttpd.git Clarifies FilesMatch and LocationMatch examples, as per bz53483 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1673498 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/core.html.en b/docs/manual/mod/core.html.en index 6b18b37ff1d..df001acda86 100644 --- a/docs/manual/mod/core.html.en +++ b/docs/manual/mod/core.html.en @@ -1796,13 +1796,17 @@ filenames does. However, it accepts a regular expression. For example:

-
<FilesMatch "\.(gif|jpe?g|png)$">
+
<FilesMatch ".+\.(gif|jpe?g|png)$">
     # ...
 </FilesMatch>

would match most common Internet graphics formats.

+
The .+ at the start of the regex ensures that + files named .png, or .gif, for example, + are not matched.
+

From 2.4.8 onwards, named groups and backreferences are captured and written to the environment with the corresponding name prefixed with "MATCH_" and in upper case. This allows elements of files to be referenced @@ -2748,6 +2752,15 @@ matching URLs

would match URLs that contained the substring /extra/data or /special/data.

+

If the intent is that a URL starts with + /extra/data, rather than merely + contains /extra/data, prefix the + regular expression with a ^ to require this.

+ +
<LocationMatch "^/(extra|special)/data">
+ +
+

From 2.4.8 onwards, named groups and backreferences are captured and written to the environment with the corresponding name prefixed with "MATCH_" and in upper case. This allows elements of URLs to be referenced diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index 73c05bfc004..a4f9f319fcc 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -1787,13 +1787,17 @@ filenames expression. For example:

-<FilesMatch "\.(gif|jpe?g|png)$"> +<FilesMatch ".+\.(gif|jpe?g|png)$"> # ... </FilesMatch>

would match most common Internet graphics formats.

+ The .+ at the start of the regex ensures that + files named .png, or .gif, for example, + are not matched. +

From 2.4.8 onwards, named groups and backreferences are captured and written to the environment with the corresponding name prefixed with "MATCH_" and in upper case. This allows elements of files to be referenced @@ -2758,6 +2762,16 @@ matching URLs

would match URLs that contained the substring /extra/data or /special/data.

+

If the intent is that a URL starts with + /extra/data, rather than merely + contains /extra/data, prefix the + regular expression with a ^ to require this.

+ + + <LocationMatch "^/(extra|special)/data"> + +
+

From 2.4.8 onwards, named groups and backreferences are captured and written to the environment with the corresponding name prefixed with "MATCH_" and in upper case. This allows elements of URLs to be referenced