httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbo...@apache.org
Subject svn commit: r1028397 - in /httpd/httpd/trunk/docs/manual/rewrite: avoid.html.en avoid.xml
Date Thu, 28 Oct 2010 17:31:59 GMT
Author: rbowen
Date: Thu Oct 28 17:31:59 2010
New Revision: 1028397

URL: http://svn.apache.org/viewvc?rev=1028397&view=rev
Log:
Introduce <If> as an alternative to mod_rewrite in the "avoiding
mod_rewrite" document.

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

Modified: httpd/httpd/trunk/docs/manual/rewrite/avoid.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/avoid.html.en?rev=1028397&r1=1028396&r2=1028397&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/avoid.html.en (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/avoid.html.en Thu Oct 28 17:31:59 2010
@@ -194,11 +194,28 @@ accomplish.</p>
 <div class="section">
 <h2><a name="setenv" id="setenv">Environment Variable Testing</a></h2>
 
-<div class="note">Parts of this section are applicable only to Apache HTTP 
-Server 2.3 and later.</div>
-
 <p>Using SetEnvIf and &lt;If&gt; (2.3 and later.)</p>
 
+<p><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
is frequently used to take a particular
+action based on the presence or absense of a particular environment
+variable or request header. This can be done more efficiently using the
+<code class="directive"><a href="../mod/core.html#if">&lt;If&gt;</a></code>.</p>
+
+<p>Consider, for example, the common scenario where
+<code class="directive">RewriteRule</code> is used to enforce a canonical
+hostname, such as <code>www.example.com</code> instead of
+<code>example.com</code>. This can be done using the <code class="directive"><a
href="../mod/core.html#if">&lt;If&gt;</a></code> direct, as shown here:</p>
+
+<div class="example"><p><code>
+&lt;If "$req{Host} = 'example.com'"&gt;<br />
+RedirectMatch (.*) http://www.example.com$1
+&lt;/If&gt;
+</code></p></div>
+
+<p>This technique can be used to take actions based on any request
+header, response header, or environment variable, replacing
+<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
in many common scenarios.</p>
+
 </div></div>
 <div class="bottomlang">
 <p><span>Available Languages: </span><a href="../en/rewrite/avoid.html"
title="English">&nbsp;en&nbsp;</a></p>

Modified: httpd/httpd/trunk/docs/manual/rewrite/avoid.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/avoid.xml?rev=1028397&r1=1028396&r2=1028397&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/avoid.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/avoid.xml Thu Oct 28 17:31:59 2010
@@ -208,11 +208,29 @@ accomplish.</p>
 
 <section id="setenv"><title>Environment Variable Testing</title>
 
-<note type="note">Parts of this section are applicable only to Apache HTTP 
-Server 2.3 and later.</note>
-
 <p>Using SetEnvIf and &lt;If&gt; (2.3 and later.)</p>
 
+<p><module>mod_rewrite</module> is frequently used to take a particular
+action based on the presence or absense of a particular environment
+variable or request header. This can be done more efficiently using the
+<directive module="core" type="section">If</directive>.</p>
+
+<p>Consider, for example, the common scenario where
+<directive>RewriteRule</directive> is used to enforce a canonical
+hostname, such as <code>www.example.com</code> instead of
+<code>example.com</code>. This can be done using the <directive
+module="core" type="section">If</directive> direct, as shown here:</p>
+
+<example>
+&lt;If "$req{Host} = 'example.com'"&gt;<br />
+RedirectMatch (.*) http://www.example.com$1
+&lt;/If&gt;
+</example>
+
+<p>This technique can be used to take actions based on any request
+header, response header, or environment variable, replacing
+<module>mod_rewrite</module> in many common scenarios.</p>
+
 </section>
 
 </manualpage> 



Mime
View raw message