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 2023/01/11 18:50:11 UTC

svn commit: r1906614 - in /httpd/httpd/branches/2.4.x/docs/manual/rewrite: intro.html.en intro.xml

Author: rbowen
Date: Wed Jan 11 18:50:11 2023
New Revision: 1906614

URL: http://svn.apache.org/viewvc?rev=1906614&view=rev
Log:
Addresses bug https://bz.apache.org/bugzilla/show_bug.cgi?id=53108

Modified:
    httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.html.en
    httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.xml

Modified: httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.html.en?rev=1906614&r1=1906613&r2=1906614&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.html.en (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.html.en Wed Jan 11 18:50:11 2023
@@ -231,7 +231,7 @@ value.
 <p>The <var>Substitution</var> can itself be one of three things:</p>
 
 <dl>
-<dt>A full filesystem path to a resource</dt>
+<dt>1. A full filesystem path to a resource</dt>
 <dd>
 <pre class="prettyprint lang-config">RewriteRule "^/games" "/usr/local/games/web"</pre>
 
@@ -239,17 +239,18 @@ value.
 like the <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code> directive.</p>
 </dd>
 
-<dt>A web-path to a resource</dt>
+<dt>2. A web-path to a resource</dt>
 <dd>
-<pre class="prettyprint lang-config">RewriteRule "^/foo$" "/bar"</pre>
+<pre class="prettyprint lang-config">RewriteRule "^/foo/?$" "/bar"</pre>
 
 <p>If <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> is set
 to <code>/usr/local/apache2/htdocs</code>, then this directive would
 map requests for <code>http://example.com/foo</code> to the
 path <code>/usr/local/apache2/htdocs/bar</code>.</p>
+
 </dd>
 
-<dt>An absolute URL</dt>
+<dt>3. An absolute URL</dt>
 <dd>
 <pre class="prettyprint lang-config">RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]</pre>
 
@@ -257,6 +258,8 @@ path <code>/usr/local/apache2/htdocs/bar
 </dd>
 </dl>
 
+<div class="warning">Note that <strong>1</strong> and <strong>2</strong> have exactly the same syntax. The difference between them is that in the case of <strong>1</strong>, the top level of the target path (i.e., <code>/usr/</code>) exists on the filesystem, where as in the case of <strong>2</strong>, it does not. (i.e., there's no <code>/bar/</code> as a root-level directory in the filesystem.)</div>
+
 <p>The <var>Substitution</var> can also
 contain <em>back-references</em> to parts of the incoming URL-path
 matched by the <var>Pattern</var>. Consider the following:</p>

Modified: httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.xml?rev=1906614&r1=1906613&r2=1906614&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.xml (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/rewrite/intro.xml Wed Jan 11 18:50:11 2023
@@ -236,7 +236,7 @@ value.
 <p>The <var>Substitution</var> can itself be one of three things:</p>
 
 <dl>
-<dt>A full filesystem path to a resource</dt>
+<dt>1. A full filesystem path to a resource</dt>
 <dd>
 <highlight language="config">
 RewriteRule "^/games" "/usr/local/games/web"
@@ -245,18 +245,19 @@ RewriteRule "^/games" "/usr/local/games/
 like the <directive module="mod_alias">Alias</directive> directive.</p>
 </dd>
 
-<dt>A web-path to a resource</dt>
+<dt>2. A web-path to a resource</dt>
 <dd>
 <highlight language="config">
-RewriteRule "^/foo$" "/bar"
+RewriteRule "^/foo/?$" "/bar"
 </highlight>
 <p>If <directive module="core">DocumentRoot</directive> is set
 to <code>/usr/local/apache2/htdocs</code>, then this directive would
 map requests for <code>http://example.com/foo</code> to the
 path <code>/usr/local/apache2/htdocs/bar</code>.</p>
+
 </dd>
 
-<dt>An absolute URL</dt>
+<dt>3. An absolute URL</dt>
 <dd>
 <highlight language="config">
 RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]
@@ -265,6 +266,8 @@ RewriteRule "^/product/view$" "http://si
 </dd>
 </dl>
 
+<note type="warning">Note that <strong>1</strong> and <strong>2</strong> have exactly the same syntax. The difference between them is that in the case of <strong>1</strong>, the top level of the target path (i.e., <code>/usr/</code>) exists on the filesystem, where as in the case of <strong>2</strong>, it does not. (i.e., there's no <code>/bar/</code> as a root-level directory in the filesystem.)</note>
+
 <p>The <var>Substitution</var> can also
 contain <em>back-references</em> to parts of the incoming URL-path
 matched by the <var>Pattern</var>. Consider the following:</p>