Redirects
A domain can redirect to another domain of the same project instead of serving an environment. The classic case: example.com redirecting to www.example.com, so search engines index one address.
Adding a redirect
Add the domain as usual, or edit an existing one, and choose redirect with:
- the domain to redirect to, one of the project's domains;
- the status code.
The redirecting domain still needs its own DNS records and verification.
Status codes
| Code | Use it when |
|---|---|
308 Permanent | The move is permanent. Browsers and search engines remember it; the request method is kept. |
301 Permanent | The same, for older clients. POST may become GET. |
307 Temporary | The redirect may change. The request method is kept. |
302 Temporary | The same, for older clients. |
How redirects behave
- The path and query string are kept:
https://example.com/pricing?plan=progoes tohttps://www.example.com/pricing?plan=pro. - The target is always
https. - Redirects are answered at the edge: your app never sees the request.
- No chains: a domain can't redirect to a domain that is itself a redirect.