From: Rich Bowen Date: Fri, 14 Jan 2011 21:08:31 +0000 (+0000) Subject: Remove unnecessary
 tags from  blocks.
X-Git-Tag: 2.3.11~202
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7cd84f2979c0f4d35c8ecfe42c0c310be13b8ed;p=apache

Remove unnecessary 
 tags from  blocks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059167 13f79535-47bb-0310-9956-ffa450edef68
---

diff --git a/docs/manual/rewrite/advanced.xml b/docs/manual/rewrite/advanced.xml
index 3347929241..22da720efc 100644
--- a/docs/manual/rewrite/advanced.xml
+++ b/docs/manual/rewrite/advanced.xml
@@ -68,37 +68,37 @@ configuration.
       

A mapping is maintained, from users to target servers, in external map files. They look like:

-
-user1  physical_host_of_user1
-user2  physical_host_of_user2
+
+user1  physical_host_of_user1
+user2 physical_host_of_user2
: : -
+

We put this into a map.users-to-hosts file. The aim is to map;

-
+
 /u/user1/anypath
-
+

to

-
+
 http://physical_host_of_user1/u/user/anypath
-
+

thus every URL path need not be valid on every backend physical host. The following ruleset does this for us with the help of the map files assuming that server0 is a default server which will be used if a user has no entry in the map:

-
-RewriteEngine on
-
-RewriteMap      users-to-hosts   txt:/path/to/map.users-to-hosts
-
+
+RewriteEngine on
+
+RewriteMap users-to-hosts txt:/path/to/map.users-to-hosts
+
RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hosts:$1|server0}/u/$1/$2 -
+ @@ -124,11 +124,11 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hos
This is done via the following ruleset: -
-# This example is valid in per-directory context only
-RewriteCond %{REQUEST_FILENAME}   !-s
+
+# This example is valid in per-directory context only
+RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^page\.html$ page.cgi [T=application/x-httpd-cgi,L] -
+

Here a request for page.html leads to an internal run of a corresponding page.cgi if @@ -164,20 +164,20 @@ RewriteRule ^page\.html$ page.cgi [ module="mod_rewrite">RewriteMap and a list of servers to accomplish this.

-
-RewriteEngine on
-RewriteMap lb rnd:/path/to/serverlist.txt
-
+
+RewriteEngine on
+RewriteMap lb rnd:/path/to/serverlist.txt
+
RewriteRule ^/(.*) http://${lb:servers}/$1 [P,L] -
+

serverlist.txt will contain a list of the servers:

-
-## serverlist.txt
-
-servers one.example.com|two.example.com|three.example.com
-
+ +## serverlist.txt
+
+servers one.example.com|two.example.com|three.example.com
+

If you want one particular server to get more of the load than the others, add it more times to the list.

@@ -218,21 +218,21 @@ featureful than anything you can cobble together using mod_rewrite.

URL causes the 'page' to be refreshed every time it is updated on the filesystem.

-
+
 RewriteRule   ^(/[uge]/[^/]+/?.*):refresh  /internal/cgi/apache/nph-refresh?f=$1
-
+

Now when we reference the URL

-
+
 /u/foo/bar/page.html:refresh
-
+

this leads to the internal invocation of the URL

-
+
 /internal/cgi/apache/nph-refresh?f=/u/foo/bar/page.html
-
+

The only missing part is the NPH-CGI script. Although one would usually say "left as an exercise to the reader" @@ -369,10 +369,10 @@ exit(0);

We use the following ruleset to expand the tilde URLs into the above layout.

-
-RewriteEngine on
+
+RewriteEngine on
RewriteRule ^/~(([a-z])[a-z0-9]+)(.*) /home/$2/$1/public_html$3 -
+
@@ -428,13 +428,13 @@ RewriteRule ^/~(([a-z])[a-z0-9]+)(.*) /home/$2>STRING and =STRING we can do time-dependent redirects:

-
-RewriteEngine on
-RewriteCond   %{TIME_HOUR}%{TIME_MIN} >0700
-RewriteCond   %{TIME_HOUR}%{TIME_MIN} <1900
-RewriteRule   ^foo\.html$             foo.day.html [L]
+
+RewriteEngine on
+RewriteCond %{TIME_HOUR}%{TIME_MIN} >0700
+RewriteCond %{TIME_HOUR}%{TIME_MIN} <1900
+RewriteRule ^foo\.html$ foo.day.html [L]
RewriteRule ^foo\.html$ foo.night.html -
+

This provides the content of foo.day.html under the URL foo.html from @@ -473,17 +473,17 @@ RewriteRule ^foo\.html$ foo.night.html

Use the [E] flag to set an environment variable.

-
-RewriteEngine on
+
+RewriteEngine on
RewriteRule ^/horse/(.*) /pony/$1 [E=rewritten:1] -
+

Later in your ruleset you might check for this environment variable using a RewriteCond:

-
+
 RewriteCond %{ENV:rewritten} =1
-
+