From 605ec51c99d869f91462a161d7a751d67c51020e Mon Sep 17 00:00:00 2001
From: Rich Bowen
<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 73c05bfc00..a4f9f319fc 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 -- 2.40.0