From 9a42f945b463a7e219cf762765fccb21a492699e Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Tue, 14 Apr 2015 18:40:41 +0000 Subject: [PATCH] Clarifies FilesMatch and LocationMatch examples, as per bz53483 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1673500 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/core.html.en | 15 ++++++++++++++- docs/manual/mod/core.xml | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/manual/mod/core.html.en b/docs/manual/mod/core.html.en index 6006c64f8f..0c9d4108da 100644 --- a/docs/manual/mod/core.html.en +++ b/docs/manual/mod/core.html.en @@ -1744,13 +1744,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 @@ -2698,6 +2702,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 0f2690d396..07195f24a6 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -1738,13 +1738,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 @@ -2711,6 +2715,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 -- 2.40.0