Duplicate Domain Versions Indexed — http, https, www, non-www

Google has indexed all four versions of your site. Each version splits link equity. How to unify under one canonical.

site:yourdomain.com returns a mix of http://yourdomain.com/article, https://yourdomain.com/article, http://www.yourdomain.com/article, and https://www.yourdomain.com/article — all serving the same content. Four URL variants for one piece of content. Each variant accumulates its own slice of link equity from external backlinks over the years, but to ranking algorithms they look like four separate pages with weak content. The fix combines forced HTTPS, www-vs-apex canonical choice, and patient consolidation via 301 redirects over weeks.

This guide consolidates the steps from HTTPS not forced and www and non-www both open into one migration plan.

Common causes

Ordered by hit rate, highest first.

1. Site predates HTTPS-by-default era

Sites launched before ~2018 often served http natively. When HTTPS was added later, http was left as-is without forced redirect. Backlinks accumulated to http for years.

How to spot it: site:yourdomain.com results include http:// URLs. Check Google Analytics referral sources — if many backlinks point to http URLs, this is your history.

2. Both www and apex serve content

Hosting added both, no redirect configured.

How to spot it: curl -sI https://yourdomain.com and curl -sI https://www.yourdomain.com both return 200.

Even with forced HTTPS now, external sites have backlinks from years ago pointing to old www/non-www variants. Google’s index still has them mapped.

How to spot it: Backlink reports (Ahrefs, Majestic) show backlinks to multiple URL variants.

4. CDN serves all four variants directly

A CDN configured without proper redirects serves all variants from cache.

How to spot it: Check CDN config for redirect rules. Without them, all variants pass through.

5. Canonical tag set inconsistently across versions

http://yourdomain.com/article has canonical pointing to itself. https://www.yourdomain.com/article has canonical pointing to itself. Without redirect, all four self-canonical and Google can’t unify.

How to spot it: View source on each variant. If all four have different self-canonicals, no version is winning.

6. Sitemap lists multiple variants

Sitemap has both http and https URLs, or both www and non-www. Confuses Google.

How to spot it: cat sitemap.xml | grep -E "^https?://" | sort -u. Should have one variant only.

Shortest path to fix

Step 1: Decide canonical

Format: https://[www-or-apex].yourdomain.com/. Pick:

  • https://yourdomain.com/ (apex)
  • https://www.yourdomain.com/ (www)

Both are fine for SEO. Pick one and document.

Step 2: 301 redirect the other three to canonical

FromTo
http://yourdomain.com/*https://[canonical]/[path]
https://yourdomain.com/* (if www is canonical)https://www.yourdomain.com/[path]
http://www.yourdomain.com/*https://[canonical]/[path]
https://www.yourdomain.com/* (if apex is canonical)https://yourdomain.com/[path]

Vercel does this automatically if you set primary. Cloudflare: use Page Rules or Bulk Redirects.

Step 3: Set HSTS

Strict-Transport-Security: max-age=63072000; includeSubDomains; preload

Forces browsers to skip http entirely. After several months of stability, submit to HSTS preload list.

# Search codebase for hardcoded URLs
grep -rn "http://yourdomain.com\|yourdomain.com/[^/]" src/ public/

Update any links pointing to non-canonical variants.

Step 5: Regenerate sitemap with canonical URLs only

Sitemap should have one entry per page using the canonical URL only.

Step 6: Update canonical tags

All pages should self-canonical to the canonical version:

<link rel="canonical" href="https://yourdomain.com/article/" />

Step 7: Submit Change of Address (if applicable)

If you’re migrating from http canonical to https, treat as a domain change in Search Console.

Step 8: Wait 4-12 weeks for consolidation

Google needs time to follow 301s and consolidate equity into the canonical. Monitor:

  • Search Console → Pages: variants showing “Page with redirect” status is good
  • Performance: total clicks should be stable or rising (split traffic consolidates)

When this is not on you

Even after fixes, old indexed versions persist in Google’s index for weeks. Be patient; don’t worry about every old URL still showing in site: queries.

Easy to misdiagnose as

Setting <link rel="canonical"> alone doesn’t force redirect. Both versions still serve. The 301 at platform level is what makes Google consolidate.

Prevention

  • Force HTTPS and pick www-vs-apex from day one of any new site.
  • Use absolute URLs (full https://canonical/path) in canonical tags, sitemap, OG tags, and JSON-LD.
  • After any infrastructure change, verify all variants 301 to canonical via curl.
  • Audit external backlinks quarterly; reach out to high-value links pointing to non-canonical variants if practical.

FAQ

  • www or non-www? No SEO difference — pick one and stick. Easier with CDN: www (CNAME); easier short URL: apex.
  • Will Google merge equity? Yes via 301 — takes 4-12 weeks. Backlinks pointing to non-canonical variants still pass equity through the redirect.

Tags: #Domain #DNS #SSL #Troubleshooting #Duplicate domain