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/14 22:13:24 UTC

svn commit: r1059169 - /httpd/httpd/trunk/docs/manual/rewrite/remapping.xml

Author: rbowen
Date: Fri Jan 14 21:13:24 2011
New Revision: 1059169

URL: http://svn.apache.org/viewvc?rev=1059169&view=rev
Log:
Remove unncessary <pre> tags inside <example> blocks.

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

Modified: httpd/httpd/trunk/docs/manual/rewrite/remapping.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/remapping.xml?rev=1059169&r1=1059168&r2=1059169&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/remapping.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/remapping.xml Fri Jan 14 21:13:24 2011
@@ -71,10 +71,10 @@ configuration.</note>
       <p>We rewrite the old URL to the new one internally via the
       following rule:</p>
 
-<example><pre>
-RewriteEngine  on
+<example>
+RewriteEngine  on<br />
 RewriteRule    ^<strong>/old</strong>\.html$  <strong>/new</strong>.html [PT]
-</pre></example>
+</example>
     </dd>
   </dl>
 
@@ -102,10 +102,10 @@ RewriteRule    ^<strong>/old</strong>\.h
       <p>We force a HTTP redirect to the new URL which leads to a
       change of the browsers and thus the users view:</p>
 
-<example><pre>
-RewriteEngine  on
+<example>
+RewriteEngine  on<br />
 RewriteRule    ^<strong>/foo</strong>\.html$  <strong>bar</strong>.html  [<strong>R</strong>]
-</pre></example>
+</example>
 </dd>
 
 <dt>Discussion</dt>
@@ -145,18 +145,18 @@ RewriteRule    ^<strong>/foo</strong>\.h
       to the new server, but you might also consider using the Redirect
       or RedirectMatch directive.</p>
 
-<example><title>With mod_rewrite</title><pre>
-RewriteEngine on
+<example><title>With mod_rewrite</title>
+RewriteEngine on<br />
 RewriteRule   ^/docs/(.+)  http://new.example.com/docs/$1  [R,L]
-</pre></example>
+</example>
 
-<example><title>With RedirectMatch</title><pre>
+<example><title>With RedirectMatch</title>
 RedirectMatch ^/docs/(.*) http://new.example.com/docs/$1
-</pre></example>
+</example>
 
 <example><title>With Redirect</title><pre>
 Redirect /docs/ http://new.example.com/docs/
-</pre></example>
+</example>
     </dd>
   </dl>
 
@@ -186,11 +186,11 @@ Redirect /docs/ http://new.example.com/d
       internally leads to the invocation of
       <code>/~quux/foo.cgi</code>.</p>
 
-<example><pre>
-RewriteEngine  on
-RewriteBase    /~quux/
+<example>
+RewriteEngine  on<br />
+RewriteBase    /~quux/<br />
 RewriteRule    ^foo\.<strong>html</strong>$  foo.<strong>cgi</strong>  [H=<strong>cgi-script</strong>]
-</pre></example>
+</example>
     </dd>
   </dl>
 
@@ -217,19 +217,21 @@ RewriteRule    ^foo\.<strong>html</stron
       existence of the new extension. If it exists, we take
       that name, else we rewrite the URL to its original state.</p>
 
-<example><pre>
-#   backward compatibility ruleset for
-#   rewriting document.html to document.php
-#   when and only when document.php exists
-&lt;Directory /var/www/htdocs&gt;
-RewriteEngine on
-RewriteBase /var/www/htdocs
-
-RewriteCond $1.php -f
-RewriteCond $1.html !-f
-RewriteRule ^(.*).html$ $1.php
+<example>
+#   backward compatibility ruleset for<br />
+#   rewriting document.html to document.php<br />
+#   when and only when document.php exists<br />
+&lt;Directory /var/www/htdocs&gt;<br />
+<indent>
+RewriteEngine on<br />
+RewriteBase /var/www/htdocs<br />
+<br />
+RewriteCond $1.php -f<br />
+RewriteCond $1.html !-f<br />
+RewriteRule ^(.*).html$ $1.php<br />
+</indent>
 &lt;/Directory&gt;
-</pre></example>
+</example>
     </dd>
 
     <dt>Discussion</dt>
@@ -322,19 +324,19 @@ Redirect /admin/ https://www.example.com
 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]
-RewriteCond %{HTTP_HOST}   !^$
-RewriteCond %{SERVER_PORT} !^80$
+<example>
+RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]<br />
+RewriteCond %{HTTP_HOST}   !^$<br />
+RewriteCond %{SERVER_PORT} !^80$<br />
 RewriteRule ^/?(.*)         http://www.example.com:%{SERVER_PORT}/$1 [L,R,NE]
-</pre></example>
+</example>
 
 <p>And for a site running on port 80</p>
-<example><pre>
-RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
-RewriteCond %{HTTP_HOST}   !^$
+<example>
+RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]<br />
+RewriteCond %{HTTP_HOST}   !^$<br />
 RewriteRule ^/?(.*)         http://www.example.com/$1 [L,R,NE]
-</pre></example>
+</example>
 
         <p>
         If you wanted to do this generically for all domain names - that
@@ -343,11 +345,11 @@ RewriteRule ^/?(.*)         http://www.e
         <strong>example.com</strong>, you could use the following
         recipe:</p>
 
-<example><pre>
-RewriteCond %{HTTP_HOST} !^www\. [NC]
-RewriteCond %{HTTP_HOST} !^$
+<example>
+RewriteCond %{HTTP_HOST} !^www\. [NC]<br />
+RewriteCond %{HTTP_HOST} !^$<br />
 RewriteRule ^/?(.*) http://www.%{HTTP_HOST}/$1 [L,R,NE]
-</pre></example>
+</example>
 
     <p>These rulesets will work either in your main server configuration
     file, or in a <code>.htaccess</code> file placed in the <directive
@@ -378,23 +380,23 @@ RewriteRule ^/?(.*) http://www.%{HTTP_HO
       resource, and, if not finding it in either place, will attempt to
       just serve it out of the location requested.</p>
 
-<example><pre>
-RewriteEngine on
-
-#   first try to find it in dir1/...
-#   ...and if found stop and be happy:
-RewriteCond         %{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}  -f
-RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir1</strong>/$1  [L]
-
-#   second try to find it in dir2/...
-#   ...and if found stop and be happy:
-RewriteCond         %{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}  -f
-RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir2</strong>/$1  [L]
-
-#   else go on for other Alias or ScriptAlias directives,
-#   etc.
+<example>
+RewriteEngine on<br />
+<br />
+#   first try to find it in dir1/...<br />
+#   ...and if found stop and be happy:<br />
+RewriteCond         %{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}  -f<br />
+RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir1</strong>/$1  [L]<br />
+<br />
+#   second try to find it in dir2/...<br />
+#   ...and if found stop and be happy:<br />
+RewriteCond         %{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}  -f<br />
+RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir2</strong>/$1  [L]<br />
+<br />
+#   else go on for other Alias or ScriptAlias directives,<br />
+#   etc.<br />
 RewriteRule   ^  -  [PT]
-</pre></example>
+</example>
     </dd>
   </dl>
 
@@ -422,22 +424,22 @@ RewriteRule   ^  -  [PT]
     <p>We'll use a <directive module="mod_rewrite">RewriteMap</directive>
     directive to build a list of servers that we wish to use.</p>
 
-<example><pre>
-HostnameLookups on
-RewriteEngine on
-RewriteMap    multiplex         txt:/path/to/map.mirrors
-RewriteCond  %{REMOTE_HOST}     ([a-z]+)$ [NC]
+<example>
+HostnameLookups on<br />
+RewriteEngine on<br />
+RewriteMap    multiplex         txt:/path/to/map.mirrors<br />
+RewriteCond  %{REMOTE_HOST}     ([a-z]+)$ [NC]<br />
 RewriteRule   ^/(.*)$  ${multiplex:<strong>%1</strong>|http://www.example.com/}$1  [R,L]
-</pre></example>
-
-<example><pre>
-##  map.mirrors -- Multiplexing Map
+</example>
 
-de        http://www.example.de/
-uk        http://www.example.uk/
-com       http://www.example.com/
+<example>
+##  map.mirrors -- Multiplexing Map<br />
+<br />
+de        http://www.example.de/<br />
+uk        http://www.example.uk/<br />
+com       http://www.example.com/<br />
 ##EOF##
-</pre></example>
+</example>
     </dd>
 
     <dt>Discussion</dt>
@@ -482,16 +484,16 @@ com       http://www.example.com/
       All other browsers receive page <code>foo.32.html</code>.
       This is done with the following ruleset:</p>
 
-<example><pre>
-RewriteCond %{HTTP_USER_AGENT}  ^<strong>Mozilla/3</strong>.*
-RewriteRule ^foo\.html$         foo.<strong>NS</strong>.html          [<strong>L</strong>]
-
-RewriteCond %{HTTP_USER_AGENT}  ^<strong>Lynx/</strong>.*         [OR]
-RewriteCond %{HTTP_USER_AGENT}  ^<strong>Mozilla/[12]</strong>.*
-RewriteRule ^foo\.html$         foo.<strong>20</strong>.html          [<strong>L</strong>]
-
+<example>
+RewriteCond %{HTTP_USER_AGENT}  ^<strong>Mozilla/3</strong>.*<br />
+RewriteRule ^foo\.html$         foo.<strong>NS</strong>.html          [<strong>L</strong>]<br />
+<br />
+RewriteCond %{HTTP_USER_AGENT}  ^<strong>Lynx/</strong>.*         [OR]<br />
+RewriteCond %{HTTP_USER_AGENT}  ^<strong>Mozilla/[12]</strong>.*<br />
+RewriteRule ^foo\.html$         foo.<strong>20</strong>.html          [<strong>L</strong>]<br />
+<br />
 RewriteRule ^foo\.html$         foo.<strong>32</strong>.html          [<strong>L</strong>]
-</pre></example>
+</example>
     </dd>
   </dl>
 
@@ -522,9 +524,9 @@ RewriteRule ^foo\.html$         foo.<str
        we replace <code>/puppies</code> and <code>/canines</code>
        by the canonical <code>/dogs</code>.</p>
 
-<example><pre>
+<example>
 RewriteRule   ^/(puppies|canines)/(.*)    /dogs/$2  [R]
-</pre></example>
+</example>
         </dd>
 
      <dt>Discussion:</dt>
@@ -532,9 +534,9 @@ RewriteRule   ^/(puppies|canines)/(.*)  
      This should really be accomplished with Redirect or RedirectMatch
      directives:
 
-     <example><pre>
+     <example>
      RedirectMatch ^/(puppies|canines)/(.*) /dogs/$2
-     </pre></example>
+     </example>
      </dd>
       </dl>
 
@@ -563,10 +565,10 @@ using the following ruleset:</p>
       <code>/about/</code>:
       </p>
      
-<example><pre>
-RewriteEngine on
+<example>
+RewriteEngine on<br />
 RewriteRule   <strong>^/$</strong>  /about/  [<strong>R</strong>]
-</pre></example>
+</example>
 
 <p>Note that this can also be handled using the <directive
 module="mod_alias">RedirectMatch</directive> directive:</p>
@@ -603,11 +605,11 @@ that should go to an existing resource s
 module="mod_dir">FallbackResource</directive> directive for this:</p>
 
 <example>
-<pre>
-&lt;Directory /var/www/my_blog&gt;
-  FallbackResource index.php
+&lt;Directory /var/www/my_blog&gt;<br />
+<indent>
+  FallbackResource index.php<br />
+</indent>
 &lt;/Directory&gt;
-</pre>
 </example>
 
 <p>However, in earlier versions of Apache, or if your needs are more
@@ -615,24 +617,22 @@ complicated than this, you can use a var
 set to accomplish the same thing:</p>
 
 <example>
-<pre>
-&lt;Directory /var/www/my_blog&gt;
-  RewriteBase /my_blog
-
-  RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-f
-  RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-d
-  RewriteRule ^ index.php [PT]
+&lt;Directory /var/www/my_blog&gt;<br />
+<indent>
+  RewriteBase /my_blog<br />
+<br />
+  RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-f<br />
+  RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-d<br />
+  RewriteRule ^ index.php [PT]<br />
+<indent>
 &lt;/Directory&gt;
-</pre>
 </example>
 
 <p>If, on the other hand, you wish to pass the requested URI as a query
 string argument to index.php, you can replace that RewriteRule with:</p>
 
 <example>
-<pre>
   RewriteRule (.*) index.php?$1 [PT,QSA]
-</pre>
 </example>
 
 <p>Note that these rulesets can be uses in a <code>.htaccess</code>