Skip to main content
Domains

Domain redirects

Redirect every request on one hostname to a canonical domain.

A redirect domain sends every request on one hostname to another URL, such as example.com → www.example.com. Pick one canonical hostname and redirect the others to it.

When you add an apex domain, Easel already offers to do this for you: it adds www to serve the site and redirects the apex to it with a 308. See Add a custom domain.

Configure a redirect

  1. Open Project settings → Domains.
  2. Add the source hostname with It should set to Redirect, or select the edit (pencil) button on an existing domain and choose Redirect.
  3. In Redirect to, enter the full destination URL, such as https://www.example.com.
  4. Choose a Status code.
  5. Save, then test over both HTTP and HTTPS.

The source hostname needs DNS like any other domain, and the redirect takes effect once it's Live. Easel issues a certificate for it so HTTPS requests redirect without a warning. If the destination is another domain on Easel, make sure it's live too.

To serve the project again, edit the domain and choose Serve this project.

Status codes

Dashboard optionUse
308 PermanentDefault. Permanent move; keeps the request method and body
307 TemporaryTemporary move; keeps the request method and body
301 Permanent, may change methodPermanent move; clients may switch POST to GET
302 Temporary, may change methodTemporary move; clients may switch POST to GET

Path and query

Easel appends the original path and query string to the destination:

https://example.com/docs/start?ref=email
→ https://www.example.com/docs/start?ref=email

Domain or application redirect

Use a domain redirect when every path on a hostname should move. Easel answers it before firewall rules, the cache, or your functions run, so your app never sees the request.

Use your framework or project configuration when the redirect depends on the path, query, headers, locale, or authentication. See Redirects and rewrites.

Avoid loops

Easel doesn't stop you from saving reciprocal redirects such as example.com → www.example.com and www.example.com → example.com. To trace a loop, see Troubleshooting.

Use the canonical hostname everywhere

A redirect consolidates traffic, but your app should still generate the canonical hostname in links, sitemaps, canonical tags, OAuth callback URLs, webhook URLs, and cookie settings.