Skip to content

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

CodeUse it when
308 PermanentThe move is permanent. Browsers and search engines remember it; the request method is kept.
301 PermanentThe same, for older clients. POST may become GET.
307 TemporaryThe redirect may change. The request method is kept.
302 TemporaryThe same, for older clients.

How redirects behave

  • The path and query string are kept: https://example.com/pricing?plan=pro goes to https://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.