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 2011/01/05 17:22:39 UTC

svn commit: r1055506 - in /httpd/httpd/trunk/docs/manual/rewrite: remapping.html.en remapping.xml

Author: rbowen
Date: Wed Jan  5 16:22:39 2011
New Revision: 1055506

URL: http://svn.apache.org/viewvc?rev=1055506&view=rev
Log:
Add examples using <If>.

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=1055506&r1=1055505&r2=1055506&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en Wed Jan  5 16:22:39 2011
@@ -284,11 +284,32 @@ hostname(s).</p>
 &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>You can alternatively accomplis this using the 
+<code class="directive"><a href="../mod/core.html#if">&lt;If&gt;</a></code>
+directive:</p>
+
+<div class="example"><p><code>
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;<br />
+<span class="indent">
+Redirect / http://www.example.com/
+</span>
+&lt;/If&gt;
+</code></p></div>
+
+<p>Or, for example, to redirect a portion of your site to HTTPS, you
+might do the following:</p>
+
+<div class="example"><p><code>
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;<br />
+<span class="indent">
+Redirect /admin/ https://www.example.com/admin/
+</span>
+&lt;/If&gt;
+</code></p></div>
+
+<p>If, for whatever reason, you still want to use <code>mod_rewrite</code>
+- if, for example, you need this to work with a larger set of RewriteRules - 
+you might use one of the recipes below.</p>
 
 <p>For sites running on a port other than 80:</p>
 <div class="example"><pre>

Modified: httpd/httpd/trunk/docs/manual/rewrite/remapping.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/remapping.xml?rev=1055506&r1=1055505&r2=1055506&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/remapping.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/remapping.xml Wed Jan  5 16:22:39 2011
@@ -286,11 +286,32 @@ hostname(s).</p>
 &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>You can alternatively accomplis this using the 
+<directive module="core" type="section">If</directive>
+directive:</p>
+
+<example>
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;<br />
+<indent>
+Redirect / http://www.example.com/
+</indent>
+&lt;/If&gt;
+</example>
+
+<p>Or, for example, to redirect a portion of your site to HTTPS, you
+might do the following:</p>
+
+<example>
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;<br />
+<indent>
+Redirect /admin/ https://www.example.com/admin/
+</indent>
+&lt;/If&gt;
+</example>
+
+<p>If, for whatever reason, you still want to use <code>mod_rewrite</code>
+- if, for example, you need this to work with a larger set of RewriteRules - 
+you might use one of the recipes below.</p>
 
 <p>For sites running on a port other than 80:</p>
 <example><pre>