From 1203b74fc36bc37afb7552b2c886919964d823db Mon Sep 17 00:00:00 2001
From: Rich Bowen
For example, you might define a +
For example, you can define a
RewriteMap
as:
RewriteMap examplemap txt:/path/to/file/map.txt@@ -171,20 +171,19 @@ RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R] per line. Optionally, a line may be contain a comment, starting with a '#' character. -
For example, the following might be valid entries in a map - file.
+A valid text rewrite map file will have the following syntax:
-+
# Comment line
MatchingKey SubstValue
MatchingKey SubstValue # comment
-
When the RewriteMap is invoked the argument is looked for in the first argument of a line, and, if found, the substitution value is returned.
-For example, we might use a mapfile to translate product names to +
For example, we can use a mapfile to translate product names to product IDs for easier-to-remember URLs, using the following recipe:
Product to ID configuration
@@ -246,7 +245,7 @@ telephone 328 One of these values will be chosen at random if the key is matched. -For example, you might use the following map +
For example, you can use the following map file and directives to provide a random load balancing between several back-end servers, via a reverse-proxy. Images are sent to one of the servers in the 'static' pool, while everything -- cgit v1.2.3