]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Provide a recipe description, (from the 2.0 docs) and make the recipe match the
authorRich Bowen <rbowen@apache.org>
Fri, 7 Dec 2007 18:26:09 +0000 (18:26 +0000)
committerRich Bowen <rbowen@apache.org>
Fri, 7 Dec 2007 18:26:09 +0000 (18:26 +0000)
description.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602173 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/misc/rewriteguide.xml

index 8a0d22cc71732ef3146324868d42846a94702d1e..a959eb3b87cab68b75e1a8bb177f3277628b9787 100644 (file)
@@ -131,19 +131,23 @@ RewriteRule   ^/([uge])/(<strong>[^/]+</strong>)$  /$1/$2<strong>/</strong>   [<
       <dl>
         <dt>Description:</dt>
 
-        <dd>...</dd>
+        <dd>The goal of this rule is to force the use of a particular
+        hostname, in preference to other hostnames which may be used to
+        reach the same site. For example, if you wish to force the use
+        of <strong>www.example.com</strong> instead of
+        <strong>example.com</strong>, you might use a variant of the
+        following recipe.</dd>
+
 
         <dt>Solution:</dt>
 
         <dd>
 <example><pre>
-RewriteCond %{HTTP_HOST}   !^fully\.qualified\.domain\.name [NC]
-RewriteCond %{HTTP_HOST}   !^$
-RewriteCond %{SERVER_PORT} !^80$
-RewriteRule ^/(.*)         http://fully.qualified.domain.name:%{SERVER_PORT}/$1 [L,R]
-RewriteCond %{HTTP_HOST}   !^fully\.qualified\.domain\.name [NC]
+# To force the use of 
+RewriteEngine On
+RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
 RewriteCond %{HTTP_HOST}   !^$
-RewriteRule ^/(.*)         http://fully.qualified.domain.name/$1 [L,R]
+RewriteRule ^/(.*)         http://www.example.com/$1 [L,R]
 </pre></example>
         </dd>
       </dl>