WebmasterID logoWebmasterID
Crawl diagnostics

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.

Verified against primary sources

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.

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

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

Sources and verification notes

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.