How do I set up redirection between www and non-www domains?

Redirection is not a requirement at all. However, it might be needed in some cases. For example:

  • the web server might accept Host headers only for and not (or vice-versa).
  • if the website uses SSL, the certificate might be bound to one domain but not to the other.

In these cases, the web server throws a 301 (permanent redirect) response and leads to browser to the other domain.

We'll use the example of a website with the domain There are actually two domains for the site – and Let's assume is being redirected to

To continue this redirection with Instart's Digital Experience Management Platform in between, there are two ways to do it:

  • We will provide a CNAME for and therefore all requests to will flow through us. Requests to will continue going to the origin and, upon getting a 301, will hit the Instart proxies.
  • We can also handle both and In that case, we can provide an A record for (since root domains can't use a CNAME). When the request hits a Instart proxy, we do the redirection to instead of this needing to be done from the origin server.
    Note that this is not possible if there are any POST requests to the domain which is going to be redirected. POST requests can't be redirected and will fail. In this case traffic needs to be sent as-is to the origin for both www and non-www domains.

If you have any questions, please contact Support.