DNS alias
- www.example.com
- A CNAME works, so you can point it at a host
- example.com (apex)
- A CNAME can't share the name with other records; you need an A/AAAA record or a provider feature
www or non-www? Google has no preference. Pick one hostname, 301 redirect the other, and keep Search Console and certificates matching both.
Google does not prefer www or non-www; the choice is yours. What matters is picking one hostname as canonical and redirecting the other to it. Google's documentation says to choose one URL as your preferred destination and use redirects to send traffic from the other versions. The real differences are technical: DNS records, cookies, and certificates.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
https://www.example.com is one of several ways a home page can be reached, and the advice is to "pick one of those URLs as your preferred (canonical) destination, and use redirects to send traffic from the other URLs to your preferred URL." Nothing in that documentation ranks one hostname above the other.The SEO risk is leaving both live. example.com/page and www.example.com/page are different URLs. If both return 200, every page exists at two URLs. Google lets you consolidate with a redirect, which it calls a strong signal, plus canonical URL tags and sitemap entries, which stack with it.
Domain attribute stays on that host onlyDomain=example.com is sent to the domain and all its subdomainsRFC 1034 says that "If a CNAME RR is present at a node, no other data should be present." The top of a zone also carries NS and SOA records, so the apex normally can't hold a CNAME. Some DNS providers work around it: Cloudflare's CNAME flattening, for example, "allows you to use a CNAME record at your zone apex" by returning the final IP address instead. Check what your host and DNS provider support before choosing.
On cookies, MDN says that setting Domain makes a cookie available to that domain and all its subdomains, and that omitting it makes it a host-only cookie. If you serve static files or an app from other subdomains and want shared cookies, the apex setup can be simpler. If you want to keep site cookies off a cookie-free asset subdomain, www can be simpler. This is a design trade-off, not a Google rule.
Check your DNS and host: can the apex point where you need it? Choose once and keep it.
Send every URL on the non-chosen host to the same path on the chosen one, preserving path and query. Google calls a permanent server-side redirect "the best way to ensure that Google Search and people are directed to the correct page."
Avoid chains such as http non-www to http www to https www. Redirect straight to the final URL.
Google notes the certificate must match your complete site URL or be a wildcard. Cover both hostnames so the redirect doesn't throw a warning.
List only the chosen hostname. Mixed signals make Google choose for you.
Use a Domain property to see both hosts together, or add the chosen host as a URL-prefix property.
server {
listen 443 ssl;
server_name www.example.com;
return 301 https://example.com$request_uri;
}This is the classic duplicate. Fix it with a redirect, not only a canonical tag.
Redirect each URL to its equivalent, not everything to /.
Google says that a certificate for the wrong host variant is a problem for HTTPS canonicalization.
Changing the hostname later means redirecting every URL again. Keep the old redirects in place.
5 questions people ask next, answered from the sources on this page.
Neither. Google's documentation tells you to pick one preferred URL and redirect the others to it, and it does not favor either hostname.
It is a hostname label in front of your registered name. MDN's URL guide lists www.example.com as the domain part of a URL, while DNS treats www as a separate name under example.com, so it can have its own records.
Yes, redirect one to the other with a 301 so there is a single version. Google calls redirects a strong signal for choosing the canonical.
A URL-prefix property does, because www.example.com does not match example.com. A Domain property includes all subdomains, www and non-www, and multiple protocols.
The DNS standard says a CNAME can't coexist with other data at a name, and the zone apex carries NS and SOA records. Some providers offer CNAME flattening to get around this.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.