Redirects
Add HTTP redirect rules to your application using regular expressions.
Redirects let you forward incoming requests from one path or host to another at the proxy (Traefik) layer, before the request reaches your application. They are useful for moving pages, enforcing a canonical domain, or pointing legacy URLs at new locations.
Configuration
Each redirect rule has the following fields:
- Regex — a regular expression matched against the incoming request URL.
- Replacement — the destination the matched request is rewritten to. You can reference capture groups from the regex (for example
${1}). - Permanent — when enabled the redirect is returned as a 301 (Moved Permanently); when disabled it is a 302 (Found / temporary).
Examples
Redirect every path to the same path on a canonical host:
Regex: ^https?://(?:www\.)?old-domain\.com/(.*)
Replacement: https://new-domain.com/${1}
Permanent: trueForce the www host to the apex domain:
Regex: ^https?://www\.example\.com/(.*)
Replacement: https://example.com/${1}
Permanent: trueRedirects are evaluated by Traefik, so they apply to all domains attached to the application. Use a permanent (301) redirect only once the destination is stable — browsers and search engines cache it aggressively.
Managing redirects
You can attach multiple redirect rules to an application and update or delete them at any time. Changes apply on the next deploy or reload.