Technical SEOSitemaps, Robots.txt & Canonicalization

WWW vs. Non-WWW and HTTP vs. HTTPS: Getting Domain-Level Canonicalization Right

Before worrying about page-level duplicate content, make sure your domain-level canonicalization is settled: every site technically has up to four possible URL variants for the homepage alone — http://example.com, https://example.com, http://www.example.com, and https://www.example.com — and if all four resolve without redirecting, you've split your domain's authority four ways before a single page-level canonical tag comes into play.

Pick One Version and Redirect Everything Else to It

Choose your preferred version — HTTPS is non-negotiable in 2026 for both security and ranking reasons, and www vs. non-www is largely a stylistic preference with no meaningful ranking difference between them. Once decided, configure server-level 301 redirects so all three other variants permanently redirect to your chosen canonical version. This should happen at the web server or CDN level (via .htaccess on Apache, server blocks on Nginx, or redirect rules in Cloudflare) rather than relying on client-side JavaScript redirects, which are slower and less reliable for crawlers.

Verify Every Redirect Is a Single-Hop 301

Check that http://www.example.com redirects directly to your final chosen version in one hop, not through an intermediate redirect chain (http to https, then https non-www to https www, as two separate redirects). Chained redirects add latency, occasionally confuse crawlers about the true canonical destination, and dilute a small amount of link equity at each hop. Use a tool like Screaming Frog or httpstatus.io to crawl your key URL variants and confirm a clean, single 301 to the final destination.

Set Your Preferred Domain in Search Console

While Search Console's old explicit "preferred domain" setting has been deprecated, verifying both the domain property and confirming your redirects are correctly implemented achieves the same outcome — Google consolidates signals to whichever version consistently resolves and is properly redirected to. Check the Domain property view in Search Console (which aggregates all protocol/subdomain variants) versus individual URL-prefix properties to confirm Google is treating your chosen version as canonical in practice.

Update Every Internal Reference to Match

Redirects fix the crawling and indexing issue, but internal links, canonical tags, sitemap URLs, and structured data should all reference your chosen canonical version directly rather than relying on a redirect to correct them. Every internal link that points to a non-canonical variant forces an unnecessary redirect hop for both users and crawlers, and at scale (thousands of internal links pointing to the wrong variant) this measurably adds up in wasted crawl budget and marginally slower navigation.

Don't Forget HSTS for HTTPS Enforcement

Implement an HTTP Strict Transport Security (HSTS) header once your HTTPS migration is stable, which instructs browsers to only ever request the HTTPS version of your site going forward, even if a user types or clicks an old http:// link. This closes the loop on HTTP/HTTPS duplication at the browser level, complementing the server-side redirects you've already configured, and adds a meaningful security benefit against certain downgrade attacks as a side effect.

Audit After Any Migration or Replatforming

Domain-level canonicalization issues resurface constantly after site migrations, replatforming, or CDN changes, since new infrastructure sometimes reintroduces a redirect path that was previously fixed. After any such change, re-crawl your key variants with the same testing approach described above, and check Search Console's Domain property for any sudden shift in which URL pattern Google is reporting as indexed, since that's often the first visible sign of a canonicalization regression. For a deeper look at this, see our guide, Best AI Tools for Technical Site Audits.

Extend the Same Logic to Subdomains

The same consolidation principle applies to subdomains hosting related content — a blog on blog.example.com, a shop on shop.example.com — where you'll want to decide deliberately whether each subdomain should be treated as an independent property in Search Console or folded conceptually under the main domain's canonical strategy, and keep internal linking and canonical tags consistent with that decision across every subdomain. For a deeper look at this, see our guide, Setting Up & Mastering Google Analytics 4.