You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2016/08/20 19:25:06 UTC

svn commit: r1757028 - /httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en

Author: covener
Date: Sat Aug 20 19:25:05 2016
New Revision: 1757028

URL: http://svn.apache.org/viewvc?rev=1757028&view=rev
Log:
xforms


Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en?rev=1757028&r1=1757027&r2=1757028&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en Sat Aug 20 19:25:05 2016
@@ -1048,32 +1048,37 @@ RewriteRule  "^/$"                 "/hom
       on where the <code class="directive">RewriteRule</code> directive is defined. </p>
 
 <div class="note"><h3><a id="what_is_matched" name="what_is_matched">What is matched?</a></h3>
-      <p>In <code class="directive"><a href="../mod/core.html#virtualhost">VirtualHost</a></code> context,
+
+<ul>
+      <li><p>In <code class="directive"><a href="../mod/core.html#virtualhost">VirtualHost</a></code> context,
       The <em>Pattern</em> will initially be matched against the part of the
       URL after the hostname and port, and before the query string (e.g. "/app1/index.html").
-      This is the (%-decoded) <a href="directive-dict.html#Syntax">URL-path</a>.</p>
+      This is the (%-decoded) <a href="directive-dict.html#Syntax">URL-path</a>.</p></li>
+
+      <li><p>In <code class="directive"><a href="../mod/core.html#directory">Directory</a></code> and htaccess context,
+      the <em>Pattern</em> is matched against only a partial path, for example a request
+      of "/app1/index.html" may result in comparison against "app1/index.html" 
+      or "index.html" depending on where the <code class="directive">RewriteRule</code> is 
+      defined.</p>
+
+      <p>In this context, only the trailing portion of the currently mapped
+      filesystem is compared against. The directory path where the rule is defined
+      is stripped before comparison (up to and including a trailing slash). 
+      The net result of this per-directory prefix stripping is that rules in
+      this context only match against the portion of the currently mapped path 
+      "below" where they are defined.</p>
 
-      <p>In <code class="directive"><a href="../mod/core.html#directory">Directory</a></code> and htaccess context,
-      the <em>Pattern</em> is matched against the trailing portion of the currently
-      mapped filesystem path with the rules own directory path removed from the beginning
-      (up to and including a trailing slash).  Directives such as <code class="directive">DocumentRoot</code> and <code class="directive">Alias</code>, or even the 
+      <p>Directives such as <code class="directive">DocumentRoot</code> and <code class="directive">Alias</code>, or even the 
       result of previous <code class="directive">RewriteRule</code> substitutions, determine
-      the currently mapped filesystem path.  The net result of this per-directory
-      prefix stripping is that rules in this context only match against the portion
-      of the currently mapped path "below" where they are defined.</p>
+      the currently mapped filesystem path.  
+      </p>
+      </li>
 
-      <p>If you wish to match against the hostname, port, or query string, use a
+      <li><p>If you wish to match against the hostname, port, or query string, use a
       <code class="directive"><a href="#rewritecond">RewriteCond</a></code> with the
       <code>%{HTTP_HOST}</code>, <code>%{SERVER_PORT}</code>, or
-      <code>%{QUERY_STRING}</code> variables respectively.</p>
-
-      <p>In any case, remember that regular expressions are substring
-      matches. That is, you don't need the regex to describe the entire
-      string, just the part that you wish to match. Thus, using a regex
-      of <code>.</code> is often sufficient rather than <code>.*</code>,
-      and the regex <code>abc</code> is <strong>not</strong> the same as
-      <code>^abc$</code>.</p>
-
+      <code>%{QUERY_STRING}</code> variables respectively.</p></li>
+</ul>
 </div>
 
 <div class="note"><h3>Per-directory Rewrites</h3>