From 430aadce59b536d533be35d333eebfe579a94d16 Mon Sep 17 00:00:00 2001 From: Ken Coar Date: Wed, 15 Apr 2015 20:04:05 +0000 Subject: * Remove trailing whitespace from a bunch of *.xml files * Quoted arguments to Rewrite{Base,Cond,Map,Rule}. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1673945 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/advanced.html.en | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'docs/manual/rewrite/advanced.html.en') diff --git a/docs/manual/rewrite/advanced.html.en b/docs/manual/rewrite/advanced.html.en index 6aea5414d1..8a723de08d 100644 --- a/docs/manual/rewrite/advanced.html.en +++ b/docs/manual/rewrite/advanced.html.en @@ -93,8 +93,8 @@ http://physical_host_of_user1/u/user/anypath a user has no entry in the map:

RewriteEngine on
-RewriteMap      users-to-hosts   txt:/path/to/map.users-to-hosts
-RewriteRule   ^/u/([^/]+)/?(.*)   http://${users-to-hosts:$1|server0}/u/$1/$2
+RewriteMap users-to-hosts "txt:/path/to/map.users-to-hosts" +RewriteRule "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2" @@ -125,8 +125,8 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hosts:$1|server0}/u/$1/$2

# This example is valid in per-directory context only -RewriteCond %{REQUEST_URI} !-U -RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L] +RewriteCond "%{REQUEST_URI}" !-U +RewriteRule "^(.+)\.html$" "/regenerate_page.cgi" [PT,L]

The -U operator determines whether the test string @@ -165,8 +165,8 @@ RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L] to accomplish this.

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

serverlist.txt will contain a list of the servers:

@@ -216,7 +216,7 @@ featureful than anything you can cobble together using mod_rewrite.

into the above layout.

RewriteEngine on
-RewriteRule   ^/~(([a-z])[a-z0-9]+)(.*)  /home/$2/$1/public_html$3
+RewriteRule "^/~(([a-z])[a-z0-9]+)(.*)" "/home/$2/$1/public_html$3" @@ -274,10 +274,10 @@ RewriteRule ^/~(([a-z])[a-z0-9]+)(.*) /home/$2
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
+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 @@ -318,13 +318,13 @@ RewriteRule ^foo\.html$ foo.night.html

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

RewriteEngine on
-RewriteRule   ^/horse/(.*)   /pony/$1 [E=rewritten:1]
+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
+
RewriteCond "%{ENV:rewritten}"  =1

Note that environment variables do not survive an external -- cgit v1.2.3