You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2015/04/14 20:39:15 UTC

svn commit: r1673498 - in /httpd/httpd/trunk/docs/manual/mod: core.html.en core.xml

Author: rbowen
Date: Tue Apr 14 18:39:15 2015
New Revision: 1673498

URL: http://svn.apache.org/r1673498
Log:
Clarifies FilesMatch and LocationMatch examples, as per bz53483

Modified:
    httpd/httpd/trunk/docs/manual/mod/core.html.en
    httpd/httpd/trunk/docs/manual/mod/core.xml

Modified: httpd/httpd/trunk/docs/manual/mod/core.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.html.en?rev=1673498&r1=1673497&r2=1673498&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.html.en Tue Apr 14 18:39:15 2015
@@ -1796,13 +1796,17 @@ filenames</td></tr>
     does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular
     expression</a>. For example:</p>
 
-<pre class="prettyprint lang-config">&lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
+<pre class="prettyprint lang-config">&lt;FilesMatch ".+\.(gif|jpe?g|png)$"&gt;
     # ...
 &lt;/FilesMatch&gt;</pre>
 
 
     <p>would match most common Internet graphics formats.</p>
 
+    <div class="note">The <code>.+</code> at the start of the regex ensures that
+    files named <code>.png</code>, or <code>.gif</code>, for example,
+    are not matched.</div>
+
     <p>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</td></tr>
     <p>would match URLs that contained the substring <code>/extra/data</code>
     or <code>/special/data</code>.</p>
 
+    <div class="note"><p>If the intent is that a URL <strong>starts with</strong>
+    <code>/extra/data</code>, rather than merely
+    <strong>contains</strong> <code>/extra/data</code>, prefix the
+    regular expression with a <code>^</code> to require this.</p>
+
+    <pre class="prettyprint lang-config">&lt;LocationMatch "^/(extra|special)/data"&gt;</pre>
+
+    </div>
+
     <p>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

Modified: httpd/httpd/trunk/docs/manual/mod/core.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml?rev=1673498&r1=1673497&r2=1673498&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml Tue Apr 14 18:39:15 2015
@@ -1787,13 +1787,17 @@ filenames</description>
     expression</glossary>. For example:</p>
 
 <highlight language="config">
-&lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
+&lt;FilesMatch ".+\.(gif|jpe?g|png)$"&gt;
     # ...
 &lt;/FilesMatch&gt;
 </highlight>
 
     <p>would match most common Internet graphics formats.</p>
 
+    <note>The <code>.+</code> at the start of the regex ensures that
+    files named <code>.png</code>, or <code>.gif</code>, for example,
+    are not matched.</note>
+
     <p>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</description>
     <p>would match URLs that contained the substring <code>/extra/data</code>
     or <code>/special/data</code>.</p>
 
+    <note><p>If the intent is that a URL <strong>starts with</strong>
+    <code>/extra/data</code>, rather than merely
+    <strong>contains</strong> <code>/extra/data</code>, prefix the
+    regular expression with a <code>^</code> to require this.</p>
+
+    <highlight language="config">
+    &lt;LocationMatch "^/(extra|special)/data"&gt;
+    </highlight>
+    </note>
+
     <p>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