httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbo...@apache.org
Subject svn commit: r921116 - in /httpd/httpd/trunk/docs/manual/rewrite: remapping.html.en remapping.xml
Date Tue, 09 Mar 2010 20:49:59 GMT
Author: rbowen
Date: Tue Mar  9 20:49:59 2010
New Revision: 921116

URL: http://svn.apache.org/viewvc?rev=921116&view=rev
Log:
Encourage people to use Redirect rather than mod_rewrite.

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

Modified: httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en?rev=921116&r1=921115&r2=921116&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en Tue Mar  9 20:49:59 2010
@@ -269,6 +269,27 @@ RewriteRule ^(.*).html$ $1.php
         <dt>Solution:</dt>
 
         <dd>
+
+<p>The very best way to solve this doesn't involve mod_rewrite at all,
+but rather uses the <code class="directive"><a href="../mod/alias.html#redirect">Redirect</a></code>
+directive places in a virtual host for the non-canonical
+hostname(s).</p>
+
+<div class="example"><pre>
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect / http://www.example.com/
+&lt;/VirtualHost&gt;
+</pre></div>
+
+<p>However, there are situations where you'll need to use mod_rewrite -
+primarily when you don't have access to the main server configuration
+file, or if you wish to do this dynamically for a larger number of
+hostnames. For these situations, you might use one of the recipes
+below.</p>
+
 <p>For sites running on a port other than 80:</p>
 <div class="example"><pre>
 RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]

Modified: httpd/httpd/trunk/docs/manual/rewrite/remapping.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/remapping.xml?rev=921116&r1=921115&r2=921116&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/remapping.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/remapping.xml Tue Mar  9 20:49:59 2010
@@ -270,6 +270,27 @@ RewriteRule ^(.*).html$ $1.php
         <dt>Solution:</dt>
 
         <dd>
+
+<p>The very best way to solve this doesn't involve mod_rewrite at all,
+but rather uses the <directive module="alias">Redirect</directive>
+directive places in a virtual host for the non-canonical
+hostname(s).</p>
+
+<example><pre>
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect / http://www.example.com/
+&lt;/VirtualHost&gt;
+</pre></example>
+
+<p>However, there are situations where you'll need to use mod_rewrite -
+primarily when you don't have access to the main server configuration
+file, or if you wish to do this dynamically for a larger number of
+hostnames. For these situations, you might use one of the recipes
+below.</p>
+
 <p>For sites running on a port other than 80:</p>
 <example><pre>
 RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]



Mime
View raw message