www vs non-www canonicalization
To a crawler, https://www.example.com and https://example.com are distinct URLs that can serve the same content, creating duplication. The fix is to choose one canonical host, redirect the other to it with a 301, and keep internal links, sitemaps, and canonical tags consistent with the chosen version.
Why www vs non-www matters
The www prefix is technically a subdomain, so www.example.com and example.com are different hostnames. If both resolve and serve the same pages, every URL effectively exists twice. Crawlers may fetch both, signals can split between them, and the index can show whichever version they happened to find.
Neither choice is inherently better for ranking; what matters is picking one and being consistent.
How to canonicalize
Decide on a canonical host — either www or non-www — then enforce it everywhere. Redirect the non-canonical host to the canonical one with a 301 so both users and crawlers converge on a single version. Keep internal links pointing at the canonical host, list only the canonical version in your sitemap, and set self-referential canonical tags to the canonical host.
Do the same for related variants (HTTP vs HTTPS, trailing slashes) so there is exactly one canonical URL per page. Avoid redirect chains where, for example, non-www HTTP hops through several stages before reaching the final URL.
- Pick one canonical host; the choice itself is neutral for ranking
- 301 the other host to the canonical one
- Align links, sitemap, and canonical tags with the chosen host
Operator checklist
Confirm one host 301-redirects to the other. Check that internal links and sitemap entries use only the canonical host. Verify canonical tags are self-referential to the canonical version. Combine with HTTPS and trailing-slash rules to avoid multi-hop redirect chains.
How it appears in analytics and logs
Serving the same content on both www and non-www hosts means crawlers see two URLs for one page, splitting signals and wasting crawl effort. Consistent redirects and canonicals tell crawlers which host is authoritative.
Diagnostic use case
Eliminate www/non-www duplication by selecting one canonical host and redirecting and referencing it consistently across the site.
What WebmasterID can help detect
WebmasterID can show which host variants crawlers reach and whether one redirects to the other, helping you confirm www/non-www canonicalization is consistent.
Common mistakes
- Serving identical content on both www and non-www with no redirect.
- Linking internally to the non-canonical host.
- Chaining non-www HTTP through several redirects to reach the final URL.
Privacy and accuracy notes
Host canonicalization concerns URLs and redirects, not personal data. WebmasterID reports redirect and host patterns for crawler traffic without exposing individual visitors.
Related pages
- HTTP vs HTTPS canonicalization
https://example.com and http://example.com are different URLs, so serving content on both creates duplication and mixed signals. The standard fix is to force HTTPS: 301-redirect HTTP to HTTPS, reference only HTTPS in links, sitemaps, and canonicals, and use HSTS so clients default to the secure scheme.
- Canonical mismatch diagnosis
A canonical mismatch happens when your rel=canonical tag points one way while redirects, sitemaps, internal links, or hreflang point another. Conflicting signals confuse which URL should represent a piece of content, so crawlers may pick a canonical you did not intend. Aligning the signals fixes it.
- Website observability
See which host variants your traffic and crawlers reach.
Sources and verification notes
- Google Search Central — Canonicalization and duplicate URLsDocuments choosing a canonical version among duplicate URLs.
- MDN — 301 Moved Permanently
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.