httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbo...@apache.org
Subject svn commit: r685415 - in /httpd/httpd/trunk/docs/manual/rewrite: rewrite_guide.html.en rewrite_guide.xml
Date Wed, 13 Aug 2008 01:49:22 GMT
Author: rbowen
Date: Tue Aug 12 18:49:22 2008
New Revision: 685415

URL: http://svn.apache.org/viewvc?rev=685415&view=rev
Log:
I've long hated this technique, in which the hostname is prepended to
the REQUEST_URI, and then munged on a second pass through. It's
confusing, hard to explain to beginners, and completely unnecessary. Use
RewriteCond backreferences instead.

Modified:
    httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en
    httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml

Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en?rev=685415&r1=685414&r2=685415&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en Tue Aug 12 18:49:22 2008
@@ -47,7 +47,7 @@
 <li><img alt="" src="../images/down.gif" /> <a href="#movehomedirs">Move
Homedirs to Different Webserver</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#multipledirs">Search
for pages in more than one directory</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#setenvvars">Set Environment
Variables According To URL Parts</a></li>
-<li><img alt="" src="../images/down.gif" /> <a href="#uservhosts">Virtual
User Hosts</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#uservhosts">Virtual
Hosts Per User</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#redirecthome">Redirect
Homedirs For Foreigners</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#redirectanchors">Redirecting
Anchors</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#time-dependent">Time-Dependent
Rewriting</a></li>
@@ -356,7 +356,7 @@
 
     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"
/></a></div>
 <div class="section">
-<h2><a name="uservhosts" id="uservhosts">Virtual User Hosts</a></h2>
+<h2><a name="uservhosts" id="uservhosts">Virtual Hosts Per User</a></h2>
 
       
 
@@ -382,10 +382,15 @@
 
 <div class="example"><pre>
 RewriteEngine on
-RewriteCond   %{<strong>HTTP_HOST</strong>}                 ^www\.<strong>[^.]+</strong>\.host\.com$
-RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
-RewriteRule   ^www\.<strong>([^.]+)</strong>\.host\.com(.*) /home/<strong>$1</strong>$2
+RewriteCond   %{<strong>HTTP_HOST</strong>}                 ^www\.<strong>([^.]+)</strong>\.host\.com$
+RewriteRule   ^(.*) /home/<strong>%1</strong>$1
 </pre></div>
+
+<p>Parentheses used in a <code class="directive"><a href="../mod/mod_rewrite.html#rewritecond">RewriteCond</a></code>
are captured into the
+backreferences <code>%1</code>, <code>%2</code>, etc, while parentheses
+used in <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>
are
+captured into the backreferences <code>$1</code>, <code>$2</code>,
+etc.</p>
         </dd>
       </dl>
 

Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml?rev=685415&r1=685414&r2=685415&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml Tue Aug 12 18:49:22 2008
@@ -350,7 +350,7 @@
 
     <section id="uservhosts">
 
-      <title>Virtual User Hosts</title>
+      <title>Virtual Hosts Per User</title>
 
       <dl>
         <dt>Description:</dt>
@@ -374,10 +374,16 @@
 
 <example><pre>
 RewriteEngine on
-RewriteCond   %{<strong>HTTP_HOST</strong>}                 ^www\.<strong>[^.]+</strong>\.host\.com$
-RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
-RewriteRule   ^www\.<strong>([^.]+)</strong>\.host\.com(.*) /home/<strong>$1</strong>$2
+RewriteCond   %{<strong>HTTP_HOST</strong>}                 ^www\.<strong>([^.]+)</strong>\.host\.com$
+RewriteRule   ^(.*) /home/<strong>%1</strong>$1
 </pre></example>
+
+<p>Parentheses used in a <directive
+module="mod_rewrite">RewriteCond</directive> are captured into the
+backreferences <code>%1</code>, <code>%2</code>, etc, while parentheses
+used in <directive module="mod_rewrite">RewriteRule</directive> are
+captured into the backreferences <code>$1</code>, <code>$2</code>,
+etc.</p>
         </dd>
       </dl>
 



Mime
View raw message