WWW vs Non-WWW: Why It Doesn’t Matter (As Long As You Do It Right)

Pick One, Redirect the Other

You’ve seen the debates. Maybe your developer told you one thing. Your SEO guy told you another. You read some Reddit thread from 2014 that got you spiraling about www vs non-www, canonical domains, and losing all your traffic.

Let’s clear this up.

It doesn’t matter if your primary site uses www or non-www.

What matters is that you pick one and redirect the other, properly. That’s it.

Let’s walk through it, squash the myths, show you exactly how to handle it technically, and explain how to make sure your SEO doesn’t get wrecked when switching.

The WWW vs Non-WWW Basics

What’s the Difference?

  • www.example.com is technically a subdomain of example.com
  • example.com (non-www) is called the root domain or apex domain
  • Both are equally valid. Google does not prefer one over the other.

The One Rule That Matters: Pick One, Redirect the Other

Why Redirecting Matters

Let’s say your site loads at both:

  • https://example.com
  • https://www.example.com

Google now sees these as two different sites unless you tell it otherwise. That’s duplicate content, wasted crawl budget, split backlinks, SEO disaster territory.

Fortunately, the fix is simple:

301 redirect the non-canonical version to the canonical version.

  • If you prefer non-www, redirect www.example.com → example.com
  • If you prefer www, redirect example.com → www.example.com

Done properly, search engines won’t care. They’ll respect your preference and consolidate authority to the one you chose.

Regex for Redirecting in .htaccess

If you’re on Apache, here’s how to enforce non-www:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301]

Want to force www instead?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^ https://www.example.com%{REQUEST_URI} [L,R=301]

And if you want a super clean regex rule that works for any domain?

# Force non-www (generic)
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

# Or force www (generic)
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Use one or the other. Not both. Not conditional. Not random. Just pick a side and stay there.

Setting Your Preferred Domain in Google Search Console

Step-by-Step:

  1. Go to Google Search Console
  2. Add both versions of your site as properties:
    • https://example.com
    • https://www.example.com
  3. Google no longer offers a direct “preferred domain” toggle, so instead:
    • Make sure your sitemaps, canonical tags, and internal links all use the same version
    • Use 301 redirects from non-preferred to preferred version
    • Submit your canonical version’s sitemap only

Google is smart. If you’re consistent, it will follow your lead.

Sitemap Considerations When Changing WWW to Non-WWW (or Vice Versa)

  • Update All Internal Links: Make sure all links point to your new preferred version.
  • Regenerate Sitemaps: Update WordPress/site URL settings so tools pick up the change.
  • Submit New Sitemap in GSC: Submit the updated sitemap for the new domain version.
  • Ensure 301 Redirects Work: Every page should redirect properly.
  • Update Canonical Tags: Ensure <link rel="canonical"> uses the new domain version.

If you’re a Headless Hostman customer, our Full Site Push services do the replacements automatically for you.

Alleviate the Anxiety — The Value is in Execution, Not the Letters

You’re not losing rankings just because you chose non-www. You’re not smarter because you picked www. You’re not losing traffic because your dev forgot to update Search Console last week.

Search engines rank based on content, structure, speed, user experience, backlinks, and consistency.

Whether you use www or not has:

  • 0% impact on page speed
  • 0% impact on crawlability (if redirected correctly)
  • 0% impact on mobile-first indexing
  • 100% impact on your stress if you keep second-guessing yourself

So chill. Execute well. Monitor with Google Search Console.

And if you need help fixing it.

Final Thoughts: Stop Obsessing. Start Directing.

Pick a version. Redirect the other. Reflect it in your sitemap. Submit to Google. Done.

Static WordPress Basically Requires www

Our Static WordPress service requires the www — or another subdomain — for Static Live Sites.

Unless you migrate your nameservers to Cloudflare.

Why Static Requires This

Static serves from a bucket of static files. It’s difficult to route an @ cname at it without CNAME flattening to mimic a non-www.

Luckily, it’s an easy fix. Migrate your nameservers and manage your DNS through Cloudflare.

Otherwise, keep it where it’s at and use the www-version. We’ll make sure all of your bases are covered.

ready to get started?

Headless Hostman takes the best of both traditional CMS systems and other static host providers to create a site that is both easy to manage, fast, and secure.