Apache Reference: mod_rewrite, RewriteMap
RewriteMap
Rewrite Map
Syntax: RewriteMap map-name map-type:A
Example: RewriteMap user-to-host txt:conf/u2h
Since: Apache 1.2
The RewriteMap directive defines a rewriting map that can be used inside rule substitution strings by the mapping functions so as to insert/substitute fields through a key lookup. Various types of sources of this lookup can be used. The map-name is used to specify a mapping function for the substitution strings of a rewriting rule via
${map-name:lookup-key[default-value]}constructs. When such a construct occurs the map, map-name is consulted and the key lookup-key is looked up. If the key is found, the looked-up value is substituted for the construct. If the key is not found, then the default-value or the empty string (if no default-value was specified) is used.The following combinations for map-type and map-source can be used: Standard Plain Text (map-type:
txt, map-source: UNIX file path to valid regular text file); Randomized Plain Text (map-type:rnd, map-source: UNIX file path to valid regular text file); Hash File (map-type:dbm, map-source: UNIX file system path to valid regular NDBM file); Internal Function (map-type:int, map-source:toupper,tolower,esca==pe, orunescape); and External Rewriting Program (map-type:prg, map-source: UNIX file system path to valid regular executable).The RewriteMap directive can occur multiple times. Keep in mind that while you cannot declare a rewriting map in a per-directory context, it is possible to use it in a per-directory context.