diff options
author | Ken Coar <coar@apache.org> | 2015-04-15 22:04:05 +0200 |
---|---|---|
committer | Ken Coar <coar@apache.org> | 2015-04-15 22:04:05 +0200 |
commit | 430aadce59b536d533be35d333eebfe579a94d16 (patch) | |
tree | fcd7eb8e221a10583db0158affd211834cbfa602 /docs/manual/rewrite/advanced.html.en | |
parent | Break <highlight language="commit">foo</highlight> into separate lines. (diff) | |
download | apache2-430aadce59b536d533be35d333eebfe579a94d16.tar.xz apache2-430aadce59b536d533be35d333eebfe579a94d16.zip |
* 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
Diffstat (limited to 'docs/manual/rewrite/advanced.html.en')
-rw-r--r-- | docs/manual/rewrite/advanced.html.en | 26 |
1 files changed, 13 insertions, 13 deletions
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:</p> <pre class="prettyprint lang-config">RewriteEngine on -RewriteMap users-to-hosts txt:/path/to/map.users-to-hosts -RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hosts:$1|server0}/u/$1/$2</pre> +RewriteMap users-to-hosts "txt:/path/to/map.users-to-hosts" +RewriteRule "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"</pre> </dd> </dl> @@ -125,8 +125,8 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hosts:$1|server0}/u/$1/$2</p This is done via the following ruleset: <pre class="prettyprint lang-config"># This example is valid in per-directory context only -RewriteCond %{REQUEST_URI} !-U -RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L]</pre> +RewriteCond "%{REQUEST_URI}" !-U +RewriteRule "^(.+)\.html$" "/regenerate_page.cgi" [PT,L]</pre> <p>The <code>-U</code> operator determines whether the test string @@ -165,8 +165,8 @@ RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L]</pre> to accomplish this.</p> <pre class="prettyprint lang-config">RewriteEngine on -RewriteMap lb rnd:/path/to/serverlist.txt -RewriteRule ^/(.*) http://${lb:servers}/$1 [P,L]</pre> +RewriteMap lb "rnd:/path/to/serverlist.txt" +RewriteRule "^/(.*)" "http://${lb:servers}/$1" [P,L]</pre> <p><code>serverlist.txt</code> will contain a list of the servers:</p> @@ -216,7 +216,7 @@ featureful than anything you can cobble together using mod_rewrite.</p> into the above layout.</p> <pre class="prettyprint lang-config">RewriteEngine on -RewriteRule ^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*) /home/<strong>$2</strong>/$1/public_html$3</pre> +RewriteRule "^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)" "/home/<strong>$2</strong>/$1/public_html$3"</pre> </dd> </dl> @@ -274,10 +274,10 @@ RewriteRule ^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*) /home/<strong>$2</stro do time-dependent redirects:</p> <pre class="prettyprint lang-config">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</pre> +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"</pre> <p>This provides the content of <code>foo.day.html</code> @@ -318,13 +318,13 @@ RewriteRule ^foo\.html$ foo.night.html</pre> <p>Use the [E] flag to set an environment variable.</p> <pre class="prettyprint lang-config">RewriteEngine on -RewriteRule ^/horse/(.*) /pony/$1 [E=<strong>rewritten:1</strong>]</pre> +RewriteRule "^/horse/(.*)" "/pony/$1" [E=<strong>rewritten:1</strong>]</pre> <p>Later in your ruleset you might check for this environment variable using a RewriteCond:</p> -<pre class="prettyprint lang-config">RewriteCond %{ENV:rewritten} =1</pre> +<pre class="prettyprint lang-config">RewriteCond "%{ENV:rewritten}" =1</pre> <p>Note that environment variables do not survive an external |