<highlight language="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"
+RewriteMap users-to-hosts "txt:/path/to/map.users-to-hosts"
+RewriteRule "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"
</highlight>
</dd>
</dl>
<highlight language="config">
# This example is valid in per-directory context only
RewriteCond "%{REQUEST_URI}" "!-U"
-RewriteRule "^(.+)\.html$" "/regenerate_page.cgi" [PT,L]
+RewriteRule "^(.+)\.html$" "/regenerate_page.cgi" [PT,L]
</highlight>
<p>The <code>-U</code> operator determines whether the test string
<highlight language="config">
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]
</highlight>
<p><code>serverlist.txt</code> will contain a list of the servers:</p>
<dt>Description:</dt>
<dd>
- <p>At time, we want to maintain some kind of status when we
+ <p>At times, we want to maintain some kind of status when we
perform a rewrite. For example, you want to make a note that
you've done that rewrite, so that you can check later to see if a
- request can via that rewrite. One way to do this is by setting an
+ request came via that rewrite. One way to do this is by setting an
environment variable.</p>
</dd>
<p>Note that environment variables do not survive an external
redirect. You might consider using the [CO] flag to set a
- cookie.</p>
+ cookie. For per-directory and htaccess rewrites, where the final
+ substitution is processed as an internal redirect, environment
+ variables from the previous round of rewriting are prefixed with
+ "REDIRECT_". </p>
</dd>
</dl>