How-To
← All guidesWebsites & Domains

How to Redirect WWW to Non-WWW (or the Reverse)

Choose one canonical hostname and redirect the other version to it.

Quick Answer

Decide whether www.example.com or example.com is primary, make both resolve correctly, then permanently redirect the alternate hostname.

Step by Step

  1. Choose the canonical hostname.
  2. Ensure DNS for both versions reaches infrastructure that can answer the request.
  3. Ensure the SSL certificate covers both hostnames.
  4. Configure a permanent redirect from the alternate hostname to the canonical one.
  5. Test HTTP and HTTPS versions of both hostnames.

If That Doesn't Work

  • DNS alone does not perform an HTTP redirect.
  • The certificate must work before an HTTPS request can receive a redirect.

Related Guides