Create your first redirect

Redirect every request for a retired name to your main domain at the edge, keeping the path and the query string.

In this example old.example.com is retired and every request should go to https://example.com with the same path and query: old.example.com/a/b?x=1 → https://example.com/a/b?x=1.

  1. Make sure the name is proxied. The edge only answers names that have a proxied DNS record (A, AAAA or CNAME with the proxy on). If every path redirects, the record's content is never used, so it can point to the same origin as the apex.

  2. Add the rule.

    Open the domain and go to Rules → Redirects → Add redirect. Set Name to old.example.com, Path prefix to /, Destination URL to https://example.com, Status to 301 · Permanent, keep Keep the rest of the path and Keep the query string on, and click Apply. Then save the change with a reason.

  3. Test it.

    curl -sI https://old.example.com/a/b?x=1
    HTTP/2 301
    location: https://example.com/a/b?x=1

Next: how redirect rules match, and the fields you can set.

Last updated:

↑↓ to navigate↵ to openesc to close