]> granicus.if.org Git - apache/commitdiff
int: example.
authorRich Bowen <rbowen@apache.org>
Wed, 19 May 2010 01:30:26 +0000 (01:30 +0000)
committerRich Bowen <rbowen@apache.org>
Wed, 19 May 2010 01:30:26 +0000 (01:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@945991 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/rewritemap.html.en
docs/manual/rewrite/rewritemap.xml

index 608100db6e5ff345913edde6465e07f71162af42..6c89ecf78153de081de41b335a2faccc0c712b4d 100644 (file)
@@ -268,12 +268,13 @@ your <code>RewriteMap</code> directive.</p>
 <div class="section">
 <h2><a name="int" id="int">int: Internal Function</a></h2>
     
-    <p>
-           MapType: <code>int</code>, MapSource: Internal Apache httpd
-          function</p>
-    <p>Here, the source is an internal Apache httpd function.
-          Currently you cannot create your own, but the following
-          functions already exist:</p>
+
+    <p>When a MapType of <code>int</code> is used, the MapSource is one
+    of the available internal RewriteMap functions. Currently there
+    is no mechanism for creating your own functions. The available
+    functions are:
+    </p>
+
     <ul>
       <li><strong>toupper</strong>:<br />
              Converts the key to all upper case.</li>
@@ -286,6 +287,25 @@ your <code>RewriteMap</code> directive.</p>
              Translates hex-encodings in the key back to
             special characters.</li>
     </ul>
+
+    <p>
+    To use one of these functions, create a <code>RewriteMap</code> referencing
+    the int function, and then use that in your <code>RewriteRule</code>:
+    </p>
+
+    <div class="example"><h3>Redirect a URI to an all-lowercase version of itself</h3><p><code>
+    RewriteMap lc int:tolower<br />
+    RewriteRule (.*[A-Z]+.*) lc($1) [R]
+    </code></p></div>
+
+    <div class="note">
+    <p>Please note that the example offered here is for
+    illustration purposes only, and is not a recommendation. If you want
+    to make URLs case-insensitive, consider using
+    <code class="module"><a href="../mod/mod_speling.html">mod_speling</a></code> instead.
+    </p>
+    </div>
+
   </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
 <h2><a name="prg" id="prg">prg: External Rewriting Program</a></h2>
index d2fe1d3c7eeedb3ce776136fd297dddfa9b2c906..119ae676ee4fdda0c20dfcdebd0fb63bd0246b37 100644 (file)
@@ -268,14 +268,16 @@ your <code>RewriteMap</code> directive.</p>
 </note>
 
   </section>
+
   <section id="int">
     <title>int: Internal Function</title>
-    <p>
-           MapType: <code>int</code>, MapSource: Internal Apache httpd
-          function</p>
-    <p>Here, the source is an internal Apache httpd function.
-          Currently you cannot create your own, but the following
-          functions already exist:</p>
+
+    <p>When a MapType of <code>int</code> is used, the MapSource is one
+    of the available internal RewriteMap functions. Currently there
+    is no mechanism for creating your own functions. The available
+    functions are:
+    </p>
+
     <ul>
       <li><strong>toupper</strong>:<br/>
              Converts the key to all upper case.</li>
@@ -288,7 +290,27 @@ your <code>RewriteMap</code> directive.</p>
              Translates hex-encodings in the key back to
             special characters.</li>
     </ul>
+
+    <p>
+    To use one of these functions, create a <code>RewriteMap</code> referencing
+    the int function, and then use that in your <code>RewriteRule</code>:
+    </p>
+
+    <example><title>Redirect a URI to an all-lowercase version of itself</title>
+    RewriteMap lc int:tolower<br />
+    RewriteRule (.*[A-Z]+.*) lc($1) [R]
+    </example>
+
+    <note>
+    <p>Please note that the example offered here is for
+    illustration purposes only, and is not a recommendation. If you want
+    to make URLs case-insensitive, consider using
+    <module>mod_speling</module> instead.
+    </p>
+    </note>
+
   </section>
+
   <section id="prg"><title>prg: External Rewriting Program</title>
   
 <p>MapType: <code>prg</code>, MapSource: Unix filesystem path to valid regular file </p>