Rules¶
A rule is the core unit of RedirectQ. Rules are evaluated in ascending sort order — the first matching rule wins.
Rule properties¶
| Property | Required | Description |
|---|---|---|
| Name | yes | Human-readable label shown in the admin and tester |
| Sort order | yes | Evaluation order; lower numbers are checked first |
| Match expression | no | Boolean expression; if omitted the rule always matches |
| Target template | yes | The redirect URL, with {token} placeholders |
| Status code | yes | HTTP redirect code (301, 302, etc.) |
| Retention days | yes | How long visit records are kept |
| Extracts | no | Named values captured from the request |
| Cookies | no | Cookies to set on the response |
Evaluation flow¶
for each rule (ordered by sort order):
1. evaluate match expression → false? skip
2. evaluate each extract → any error? skip
3. resolve target template
4. return redirect
If no rule matches, the redirector returns 404.