Decide whether www.example.com or example.com is primary, make both resolve correctly, then permanently redirect the alternate hostname.
Step by Step
- Choose the canonical hostname.
- Ensure DNS for both versions reaches infrastructure that can answer the request.
- Ensure the SSL certificate covers both hostnames.
- Configure a permanent redirect from the alternate hostname to the canonical one.
- 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.
