Static Maps¶
A static map is a simple key → value lookup table. Use them to translate path segments, query parameters, or other request values into redirect targets or URL fragments.
Usage in expressions¶
See Functions → Map functions for full documentation.
Example¶
A map named products with entries:
| Key | Value |
|---|---|
1 |
running-shoes-v2 |
2 |
trail-jacket |
42 |
foam-roller |
A rule with:
- Match expression:
Map("products", Segment(Path, 1)) != "" - Extract
slug:Map("products", Segment(Path, 1)) - Target:
https://shop.example.com/p/{slug}
A request to /1 redirects to https://shop.example.com/p/running-shoes-v2.
A request to /99 does not match (map returns "", expression is false).
Missing keys¶
Map() returns "" for unknown keys — it does not throw. If you want to redirect unknown keys to a fallback URL, use MapOrDefault() instead, or handle it with a separate catch-all rule.