Error guide / www version of the site does not work

The www version of the site does not work

example.com and www.example.com are two different hostnames, not two spellings of the same one. Each needs its own DNS record, its own entry in the web server configuration, and its own name on the TLS certificate. When one of them loads and the other times out, shows a default hosting page or throws a certificate warning, one of those three layers is set up for only one of the names. Owners usually notice after a migration, a DNS change or a fresh install, and often only because a visitor or a search result used the other form of the address.

Check your site

>

What causes it

Most often there is simply no A, AAAA or CNAME record for the www hostname: the record for the bare domain does not cover subdomains, so www has to be listed separately. Next most common is a record that does exist but still points at the old server after a migration, so the name resolves to a machine that no longer hosts the site. If both names resolve to the correct IP, the fault moves up a layer: the web server may have a virtual host for only one name and answer the other with a default page or even someone else's site, or the certificate may cover one name only, which produces a security warning rather than a failure. Last, the redirect between the two names gets configured in one direction only, or the two point at each other and loop.

How to fix it

  1. Run the DNS check on this page twice, once for example.com and once for www.example.com, typed exactly as they appear in the address bar. If the failing name comes back with no A, AAAA or CNAME record while the working name returns one, the problem is in DNS and step 2 is your fix. If both names return records, DNS is fine and you can skip to step 4.
  2. Add the missing record in the zone editor of whoever actually runs your DNS (registrar, hosting panel, or Cloudflare if the domain is there). For a missing www, the usual form is a CNAME named www pointing at example.com, or an A record for www carrying the same IP as the bare name. For a missing bare domain you cannot use a CNAME: the apex can only hold A or AAAA, which is exactly why many providers offer ALIAS or ANAME types as a workaround when the target is a hostname. Keep in mind that a CNAME cannot coexist with other records under the same name, so if www already has TXT or other entries, use an A record there instead. Re-run the check after the record's TTL has passed.
  3. If both names resolve but to different addresses, one of them is stale. Compare the IPs the check returns for each hostname, decide which one is the server you actually use today, and correct the other record to match.
  4. If both names resolve to the same IP but one of them serves a default page, a parking page or another site, DNS is not the problem: the web server has no virtual host for that name. Add it as a ServerAlias in Apache, to server_name in nginx, or as a domain alias in your hosting control panel, then reload the web server.
  5. If the second name loads but the browser warns about the certificate (an error mentioning an invalid common name or that the certificate is not valid for this hostname), the certificate covers only one of the two. Reissue it for both names in one certificate. Most panels and Let's Encrypt clients do this automatically once both hostnames resolve to the server.
  6. Pick one hostname as canonical and 301 the other to it, in one direction only. Both names should resolve and both should be on the certificate, but only one should serve content. After the change, request each name and confirm you get a single 301 to the canonical name followed by a 200, not a chain that bounces between the two.

Related errors