The directive defines a function which'll lookup a key in the defined map and substitutes the lookup with its replacement from the map.
The mapping function is defined with the RewriteMap
directive itself as follows:
RewriteMap MAPNAME Type:Source
and can be referenced in any of the RewriteCond
or RewriteRule
directives to act as a substitution guide as follows:
${ MAPNAME : KEY | DEFAULT }
The following are valid values for Type
in the map definition:
int
- allows toupper
, tolower
, escape
and unescape
onlytxt
- searches a text filedbd
- looks up in a database using SQL SELECT
statementrnd
- random lookups from text filedbm
- similar to txt
, except that the httxt2dbm
needs to convert the data to hashesfastdbd
- looks up in a database using SQL SELECT
statement with caching