Target Templates¶
The target template is the URL the visitor is redirected to. It supports {token} placeholders that are replaced at runtime.
Available tokens¶
Request tokens¶
| Token | Value |
|---|---|
{Host} |
Request host, e.g. example.com |
{Path} |
Request path, e.g. /shop/product/42 |
{Query} |
Raw query string (without ?), e.g. lang=nl&ref=email |
{Scheme} |
http or https |
{Ip} |
Client IP address |
Extract tokens¶
Any extract defined on the rule is available as {extractName}.
Examples¶
Redirect to a different domain, preserving path and query:
Redirect using a mapped value:
With an extract named targetUrl that resolves via Map("products", Segment(Path, 1)):
Reconstruct the URL with a language prefix stripped:
With an extract named rest capturing the path after the language segment:
Forward only the query string:
Token resolution order¶
- Extract names are checked first.
- If no extract matches the token name, the built-in request tokens are used.
- If neither matches, the token resolves to
"".
Note
Tokens are case-sensitive. {path} and {Path} are different.