How can we help?

Redirects

Redirects tell users that content has moved. The redirects setting is an array of mappings, each of which consists of a regex and a replacement value plus an optional permanent value.

[
    {
        "regex": "/old/",
        "replacement": "/new/",
        "permanent": true
    }
]

The above example would cause all browser requests to /old/ to go to /new/. The permanent value is optional and defaults to ‘true’.

As the name suggests, regex accepts regular expressions.

[
    {
        "regex": "/old/(.*)/?$",
        "replacement": "/new/${1}/",
    }
]

This example would take all pages underneath /old/ and redirect them to a page of the same name under /new/. For example, /old/my-page would redirect to /new/my-page/.

Details

When an edge server receives a redirect HTTP request, it responds with a new location for the browser to go to. Permanent redirects respond with HTTP status code 301 Moved Permanently and temporary (non-permanent) redirects use status code 307 Temporary Redirect. Since these responses are generated at the edge servers, the request never reaches your origin server.

Proxies differ from redirects in that proxies fetch the content directly and never tell the client/browser that the data came from a different location.