Back to dispatches
§ Dispatch № 253

WWW vs. Non-WWW: Choosing and Enforcing Your Canonical Domain

Pick www or non-www and enforce it. The duplicate-content fix most founders skip. Step-by-step guide to 301 redirects, canonical tags, and GSC setup.

Filed
May 5, 2026
Read
17 min
Author
The Seoable Team

The Problem Most Founders Don't Know They Have

Your site is live. Traffic is trickling in. You're shipping features. Then you notice something: Google is indexing both example.com and www.example.com. Your analytics are split. Your backlinks are scattered across two versions. Your SEO juice is diluted.

This is the duplicate-content trap. And it's costing you visibility.

Google treats www.example.com and example.com as two separate domains. Without explicit enforcement, search engines don't know which one you prefer. They crawl both. They index both. They count links to both. Your authority gets split in half.

The fix is brutal in its simplicity: pick one canonical host and enforce it everywhere. But most founders skip this step entirely. They're too busy shipping features to worry about www redirects.

Here's the truth: this one decision—made right in the first 60 days—compounds for years. Get it wrong, and you're handicapping your organic visibility from day one. Get it right, and you're consolidating every signal into a single, authoritative domain.

This guide walks you through the decision, the implementation, and the verification. By the end, you'll have eliminated duplicate content at the domain level and told Google exactly which version of your site to rank.

Prerequisites: What You Need Before You Start

Before you enforce your canonical domain, gather these essentials:

Access and Credentials

  • Admin access to your DNS provider (GoDaddy, Namecheap, Route 53, Cloudflare, etc.)
  • Admin access to your web server or hosting control panel (cPanel, Plesk, AWS, Vercel, Netlify, etc.)
  • Admin access to your site's CMS or framework configuration (WordPress, Next.js, etc.)
  • Google Search Console (GSC) verification for both www and non-www versions
  • Google Analytics access (if you're running it)

Current State Knowledge

  • Your current domain structure (is it www or non-www right now?)
  • Which version is currently live and getting traffic
  • Whether you have any existing 301 redirects in place
  • How many pages are indexed in Google (check GSC)
  • Whether you've already set a preferred domain in GSC

Technical Understanding

  • Basic knowledge of HTTP status codes (301 = permanent redirect)
  • Understanding of what a canonical tag is (we'll explain it below, but you should know it's a <link rel="canonical"> tag in your HTML)
  • Familiarity with your hosting environment (shared hosting, VPS, or platform-as-a-service)

If you're missing any of these, stop and gather them first. Implementing redirects without GSC access is like shipping code without version control—possible, but dangerous.

Understanding the Duplicate Domain Problem

When Google crawls your site, it sees two different URLs:

  • example.com/about
  • www.example.com/about

Technically, these are different resources. The server might serve identical content from both, but from Google's perspective, they're distinct URLs. This creates three problems:

Problem 1: Split Authority

Backlinks to your site might point to either version. Some link to example.com, others to www.example.com. Your link equity—your domain authority—gets divided between two addresses instead of consolidated into one. According to www vs non www guidance from MDN Web Docs, this split is one of the primary reasons to enforce a canonical host.

Problem 2: Crawl Budget Waste

Googlebot has a limited crawl budget—the number of pages it will crawl on your site per day. If it's crawling both www.example.com and example.com, you're wasting half your budget on duplicate content. For large sites, this is critical. For startups, it means Google might not crawl your new content as quickly.

Problem 3: Ranking Confusion

Google might index and rank either version for a given query. Your organic search results might show www.example.com/pricing for one search and example.com/pricing for another. Your click-through rate suffers because users don't know which version is "official." Your analytics get fragmented.

The solution is to pick one canonical host and tell Google—explicitly and redundantly—that this is the version you want indexed and ranked.

Step 1: Choose Your Canonical Host (WWW or Non-WWW)

This is a one-time decision. Make it now, and you won't revisit it.

The Technical Reality

From a pure SEO perspective, there is no difference. According to Google's official guidance on consolidating duplicate URLs, www and non-www are equivalent in terms of ranking potential. John Mueller from Google has confirmed this repeatedly: the choice doesn't matter as long as you're consistent.

The Practical Factors

  1. Email domains: If your email is hello@example.com, a non-www domain feels more natural. If your email is hello@mail.example.com, www is less relevant.

  2. Subdomain strategy: If you're using subdomains (like api.example.com or blog.example.com), www can feel redundant. Non-www gives you more flexibility.

  3. CDN and DNS: Some CDN providers (like Cloudflare) have slight preferences. Check your provider's documentation.

  4. Historical precedent: If your site has been live for years and one version has more backlinks, stick with that version. The cost of switching is higher than the benefit.

  5. User expectation: In 2024, non-www is increasingly common and feels modern. But www is still widely used and understood.

The Recommendation

For new sites and bootstrapped founders, choose non-www (example.com). It's shorter, easier to type, and increasingly the default. But if you have existing traffic and backlinks pointing to www, keep www. The migration cost isn't worth it.

For this guide, we'll use non-www as the canonical choice. If you're choosing www, the steps are identical—just reverse the redirect direction.

Step 2: Set Up 301 Redirects from Your Hosting

A 301 redirect is a permanent redirect. It tells search engines and browsers: "This URL has permanently moved. Go here instead." Unlike a 302 (temporary) redirect, 301s pass SEO authority from the old URL to the new one.

You need to redirect www.example.comexample.com (and all subpaths).

For WordPress Sites

Option A: Via WordPress Settings (Easiest)

  1. Log in to WordPress admin
  2. Go to SettingsGeneral
  3. Check your "WordPress Address (URL)" and "Site Address (URL)"
  4. Change both to your non-www version: https://example.com
  5. Save changes
  6. WordPress will automatically handle the redirect

This works because WordPress natively redirects the www version to your configured address. Verify it's working by visiting https://www.example.com in a browser—you should see the URL change to https://example.com in the address bar.

Option B: Via .htaccess (If WordPress Settings Don't Work)

If you're on a shared hosting with Apache, edit your .htaccess file in the root directory:

# Remove www from URL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

Upload this file via FTP or your hosting control panel's file manager. Test the redirect by visiting https://www.example.com in a browser.

For Next.js / Vercel

Add this to your next.config.js:

module.exports = {
  async redirects() {
    return [
      {
        source: '/:path*',
        has: [
          {
            type: 'host',
            value: 'www.example.com',
          },
        ],
        destination: 'https://example.com/:path*',
        permanent: true,
      },
    ]
  },
}

Deploy this change. Vercel will automatically serve 301 redirects.

For Node.js / Express

Add this middleware early in your server:

app.use((req, res, next) => {
  if (req.hostname === 'www.example.com') {
    return res.redirect(301, `https://example.com${req.originalUrl}`);
  }
  next();
});

For Static Sites (HTML, Netlify, etc.)

Netlify:

Add to your netlify.toml:

[[redirects]]
  from = "https://www.example.com/*"
  to = "https://example.com/:splat"
  status = 301
  force = true

GitHub Pages / Static Hosting:

Add a redirect in your DNS provider's settings (see Step 3 below).

Verify Your Redirects Work

After implementing redirects, test them:

  1. Visit https://www.example.com in your browser
  2. Check the address bar—it should change to https://example.com
  3. Open developer tools (F12) → Network tab
  4. Reload the page
  5. Look for the first request to www.example.com—it should show a 301 status code
  6. The next request should be to example.com with a 200 status code

If you see 302, 307, or 200 on the www version, your redirect isn't set up correctly. Go back and troubleshoot.

Step 3: Verify DNS and SSL/TLS Configuration

Before Google crawls your site, make sure your DNS is pointing correctly and your SSL certificate covers both versions.

DNS Setup

You need both versions of your domain to resolve to the same IP address:

  1. Log in to your DNS provider (GoDaddy, Namecheap, Route 53, etc.)
  2. Find your A records and CNAME records
  3. Verify that both example.com and www.example.com point to the same IP or hostname

For most modern hosting:

  • example.com (A record) → your server IP
  • www.example.com (CNAME record) → example.com

Or both as CNAME records pointing to your hosting provider's domain (e.g., example.herokuapp.com).

If they point to different IPs, the www version won't redirect—it'll serve a completely different site. Fix this immediately.

SSL/TLS Certificate

Your SSL certificate must cover both example.com and www.example.com. Most providers (Let's Encrypt, Cloudflare, AWS ACM) automatically issue certificates for both the base domain and the www subdomain.

Verify this:

  1. Visit https://www.example.com in your browser
  2. Click the lock icon → Certificate
  3. Look for "Subject Alternative Names" (SANs)
  4. You should see both example.com and www.example.com listed

If only one is listed, request a new certificate that covers both. Most hosting providers can do this automatically—just trigger a certificate renewal.

Step 4: Add Canonical Tags to Your HTML

Even with 301 redirects in place, add a canonical tag to every page. This is redundant but powerful—it's your backup enforcement mechanism.

A canonical tag tells search engines: "This is the preferred version of this page." It looks like this:

<link rel="canonical" href="https://example.com/about" />

This goes in the <head> section of your HTML.

For WordPress

If you're using Yoast SEO or Rank Math, canonical tags are handled automatically. Verify:

  1. View the source of any page (right-click → View Page Source)
  2. Search for rel="canonical"
  3. You should see https://example.com/... (non-www)

If you see www versions, go to your SEO plugin settings and check the configuration.

If you're not using an SEO plugin, add this to your WordPress functions.php:

add_action('wp_head', function() {
  echo '<link rel="canonical" href="' . esc_url(home_url(add_query_arg(array()))) . '" />';
});

For Next.js

Add this to your page template or layout:

import Head from 'next/head';

export default function Page() {
  return (
    <Head>
      <link rel="canonical" href="https://example.com/page-path" />
    </Head>
  );
}

For dynamic pages, construct the URL dynamically:

const canonicalUrl = `https://example.com${router.asPath}`;

For Other Frameworks

Add the canonical tag to your base template or layout component. The key is ensuring every page includes it, and the href always points to the non-www version.

Verify Canonical Tags

  1. Visit any page on your site
  2. View page source (Ctrl+U or right-click → View Page Source)
  3. Search for rel="canonical"
  4. Confirm it points to https://example.com/... (not www)

Do this for 5-10 random pages across your site. If any page is missing the canonical tag, fix your template.

Step 5: Configure Google Search Console

Google Search Console (GSC) is where you tell Google which version of your domain you prefer. This is critical.

Step 5A: Verify Both Versions in GSC

  1. Go to Google Search Console
  2. Click "Add property"
  3. Add both versions:
    • https://example.com (non-www)
    • https://www.example.com (www)
  4. Verify ownership for each (via HTML file, DNS record, or Google Analytics)

You'll have two separate GSC properties. This is normal and necessary.

Step 5B: Set Preferred Domain in GSC

  1. In GSC, go to the non-www property (https://example.com)
  2. Click the gear icon (Settings) in the bottom left
  3. Select "Preferred domain"
  4. Choose the non-www version: example.com
  5. Save

This tells Google: "When you see both versions of my site, prefer the non-www version."

According to Google's official documentation on consolidating duplicate URLs, this setting, combined with your 301 redirects and canonical tags, will consolidate all your authority into the non-www domain.

Step 5C: Monitor the Consolidation

After setting the preferred domain, watch your GSC data:

  1. Go to Coverage in GSC
  2. Check how many pages are indexed for the non-www version
  3. Go to the www property and check its coverage
  4. Over the next 1-2 weeks, you should see:
    • Non-www coverage stay stable or grow
    • www coverage shrink to near-zero (Google will de-index the www versions)

If you see the opposite—www growing and non-www shrinking—your redirect isn't working. Go back to Step 2 and debug.

Step 6: Update Internal Links and Sitemaps

Now that you've enforced your canonical domain, make sure all internal links point to the non-www version.

Audit Internal Links

Use a tool like Screaming Frog or your CMS's link checker:

  1. Crawl your site
  2. Look for any internal links that point to www.example.com
  3. Change them to example.com

For WordPress, use a find-and-replace plugin:

  1. Install "Better Search Replace"
  2. Search for https://www.example.com
  3. Replace with https://example.com
  4. Run the replacement

Update Your Sitemap

Your XML sitemap should list only the non-www versions:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2024-01-15</lastmod>
  </url>
  <url>
    <loc>https://example.com/about</loc>
    <lastmod>2024-01-14</lastmod>
  </url>
</urlset>

If you're using WordPress, regenerate your sitemap via Yoast SEO or another plugin. If you're on Next.js, update your sitemap.ts to use the non-www domain.

Submit Updated Sitemap to GSC

  1. In GSC (non-www property), go to Sitemaps
  2. Submit your sitemap URL: https://example.com/sitemap.xml
  3. GSC will crawl and index the pages listed

Do NOT submit the www sitemap. You only have one canonical domain now.

Step 7: Redirect Other Subdomains (If Applicable)

If you have other subdomains (like blog.example.com or api.example.com), they don't need to redirect to the main domain. But they should also have their own canonical enforcement.

For example, if you have a blog subdomain:

  1. Set up 301 redirects so www.blog.example.comblog.example.com
  2. Add canonical tags pointing to https://blog.example.com/...
  3. Verify the subdomain in GSC and set it as preferred

Subdomains are treated as separate properties by Google, so each one should have its own canonical enforcement.

Step 8: Test Everything (The Verification Checklist)

Before you consider this done, run through this checklist:

Browser Tests

  • Visit https://www.example.com → URL changes to https://example.com
  • Visit https://www.example.com/about → URL changes to https://example.com/about
  • Visit http://example.com (no https) → URL changes to https://example.com
  • Visit http://www.example.com (no https) → URL changes to https://example.com

Developer Tools Tests

  • Open DevTools (F12) → Network tab
  • Visit https://www.example.com
  • First request shows 301 status code
  • Second request shows 200 status code for non-www domain

Source Code Tests

  • View page source on 5 random pages
  • Every page has <link rel="canonical" href="https://example.com/...">
  • No page has a canonical tag pointing to www

GSC Tests

  • Both www and non-www properties exist in GSC
  • Non-www property has preferred domain set
  • Sitemap is submitted and indexed
  • Coverage shows only non-www pages indexed

Analytics Tests

  • Google Analytics shows traffic from only one domain (non-www)
  • No traffic appears under the www version

If any of these fail, troubleshoot before moving forward.

Common Mistakes to Avoid

Mistake 1: Forgetting the Redirect

You add canonical tags but no 301 redirect. Google sees both versions in the wild and doesn't know which to trust. The canonical tag helps, but it's not enough. You need the redirect.

Mistake 2: Using a 302 Redirect Instead of 301

A 302 is a temporary redirect. Google will keep crawling and indexing both versions. Always use 301 for domain consolidation.

Mistake 3: Redirecting the Wrong Direction

If you choose non-www as canonical, redirect www → non-www. If you choose www, redirect non-www → www. Getting this backwards creates a redirect loop. Test immediately after implementation.

Mistake 4: Not Setting Preferred Domain in GSC

You set up redirects and canonical tags, but you never tell Google which version you prefer in GSC. Google might still index both versions. This setting is the final enforcement.

Mistake 5: Forgetting About External Backlinks

Your backlinks are scattered across both www and non-www. The 301 redirect will consolidate them over time, but you can speed this up by reaching out to sites linking to the www version and asking them to update their links. For new sites, this is less critical. For established sites, it can be worth the effort.

Mistake 6: Not Updating Internal Links

You redirect www to non-www, but your internal links still point to www. This creates unnecessary redirects on every click. Update all internal links to point directly to the canonical version.

Why This Matters for Founders

You're shipping fast. You're focused on product. You don't have time for SEO minutiae.

But this one decision—picking and enforcing a canonical domain—is not minutiae. It's foundational. According to SE Ranking's guidance on www vs non-www domains, this single choice affects how Google crawls your site, how authority accumulates, and how quickly you rank.

Do this in week one. It takes 2-3 hours. You'll never touch it again. But for the next five years, every backlink, every internal link, every piece of authority will flow into a single, consolidated domain.

Compare that to the founder who ships without making this decision. Their authority is split. Their crawl budget is wasted. Their organic visibility is handicapped from day one.

The brutal truth: you can't afford to skip this. Not because it's complicated—it's not. But because the cost of getting it wrong compounds over time.

The Modern SEO Context: Why Canonical Matters More Now

In 2024, canonical domain enforcement matters more than ever. Here's why:

AI Engines Are Crawling Too

According to recent analysis of crawler differences between Googlebot, GPTBot, and ClaudeBot, ChatGPT, Claude, and Perplexity are all crawling your site independently. If you have duplicate content across www and non-www, these AI engines might cite the wrong version—or worse, cite both and confuse users.

Duplicate Content Penalties Are Real

While Google doesn't penalize duplicate content, it does dilute your authority. With the rise of AI-generated content and content syndication, keeping your own house clean—one canonical domain—is more important than ever.

Crawl Budget Is Scarce

Googlebot has limited resources. Every request to www.example.com is a request that could have gone to a new page. As you scale, this matters more.

Quick Reference: Platform-Specific Setup

If you're building on a specific platform, here's the fastest path:

WordPress + Yoast SEO

  1. Settings → General → Change both URLs to non-www
  2. Yoast will add canonical tags automatically
  3. Add 301 redirect via .htaccess or hosting panel
  4. Verify in GSC

Next.js + Vercel

  1. Add redirect config to next.config.js
  2. Add canonical tags to page templates
  3. Deploy
  4. Verify in GSC

Shopify

  1. Settings → Domains → Set primary domain to non-www
  2. Shopify handles redirects and canonical tags automatically
  3. Verify in GSC

Webflow

  1. Project Settings → Hosting → Primary Domain (choose non-www)
  2. Webflow handles redirects and canonical tags
  3. Verify in GSC

Static Site (GitHub Pages, Netlify)

  1. Add redirect rule in netlify.toml or _redirects file
  2. Add canonical tags to HTML templates
  3. Deploy
  4. Verify in GSC

Wrapping Up: The One Decision That Compounds

You've now:

  1. Chosen your canonical domain (non-www recommended)
  2. Implemented 301 redirects from the other version
  3. Added canonical tags to every page
  4. Configured Google Search Console to prefer your chosen domain
  5. Updated internal links and sitemaps
  6. Verified everything is working

This is done. You won't revisit it. But for the next five years, every backlink, every internal link, every crawl will flow into a single, authoritative domain.

Compare this to the startup that ships without making this decision. Their authority is split. Their rankings are diluted. Their organic visibility is handicapped.

You're not that startup.

If you're building your SEO strategy from scratch, this decision is just the beginning. Check out week one of SEO for busy founders to understand what else needs to ship in your first week. If you want to understand the broader technical SEO context, read the 5 pillars of modern SEO every founder should master to see where canonical domain enforcement fits into the bigger picture.

For those just starting out, your first 100 days of SEO: a day-by-day founder playbook breaks down exactly when and how to tackle this alongside your other SEO priorities.

The canonical domain decision is foundational. Make it now. Make it right. Then move on to the next thing that matters.

§ The Dispatch

Get the next
dispatch on Monday.

One email per week with the most important SEO and AEO moves for founders. Unsubscribe in one click.

Free · Weekly · Unsubscribe anytime