Free auditStart free
GlossaryGlossary · Crawling and indexing

www vs non-www

www or non-www? Google has no preference. Pick one hostname, 301 redirect the other, and keep Search Console and certificates matching both.

4 min
read
7
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
In one line

Google does not prefer www or non-www; the choice is yours. What matters is picking one hostname as canonical and redirecting the other to it. Google's documentation says to choose one URL as your preferred destination and use redirects to send traffic from the other versions. The real differences are technical: DNS records, cookies, and certificates.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01Explained

Does www vs non-www matter for SEO?

Not by itself. In Google's redirects documentation, https://www.example.com is one of several ways a home page can be reached, and the advice is to "pick one of those URLs as your preferred (canonical) destination, and use redirects to send traffic from the other URLs to your preferred URL." Nothing in that documentation ranks one hostname above the other.

The SEO risk is leaving both live. example.com/page and www.example.com/page are different URLs. If both return 200, every page exists at two URLs. Google lets you consolidate with a redirect, which it calls a strong signal, plus canonical URL tags and sitemap entries, which stack with it.

03How it works

Pick one and redirect the other

  1. 1

    Choose the canonical hostname

    Check your DNS and host: can the apex point where you need it? Choose once and keep it.

  2. 2

    Redirect the other host with a 301

    Send every URL on the non-chosen host to the same path on the chosen one, preserving path and query. Google calls a permanent server-side redirect "the best way to ensure that Google Search and people are directed to the correct page."

  3. 3

    Redirect http to https in one hop

    Avoid chains such as http non-www to http www to https www. Redirect straight to the final URL.

  4. 4

    Match your certificate

    Google notes the certificate must match your complete site URL or be a wildcard. Cover both hostnames so the redirect doesn't throw a warning.

  5. 5

    Update internal links, canonicals, and the sitemap

    List only the chosen hostname. Mixed signals make Google choose for you.

  6. 6

    Verify in Search Console

    Use a Domain property to see both hosts together, or add the chosen host as a URL-prefix property.

Example: redirect www to the apex
server {
  listen 443 ssl;
  server_name www.example.com;
  return 301 https://example.com$request_uri;
}
04Worth knowing

Common mistakes

Both versions return 200

This is the classic duplicate. Fix it with a redirect, not only a canonical tag.

Redirecting to the home page

Redirect each URL to its equivalent, not everything to /.

Certificate mismatch

Google says that a certificate for the wrong host variant is a problem for HTTPS canonicalization.

Changing your mind later

Changing the hostname later means redirecting every URL again. Keep the old redirects in place.

Sources · 7

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • google.com
  • rfc-editor.org
  • cloudflare.com
  • mozilla.org
  1. 01Redirects and Google Searchdevelopers.google.com · checked 2026-10-25
  2. 02What is canonicalization and how to consolidate duplicate URLsdevelopers.google.com · checked 2026-10-25
  3. 03Verify your site ownership: property types - Search Console Helpsupport.google.com · checked 2026-10-25
  4. 04RFC 1034: Domain names - concepts and facilitiesrfc-editor.org · checked 2026-10-25
  5. 05CNAME flattening - Cloudflare DNS docsdevelopers.cloudflare.com · checked 2026-10-25
  6. 06What is a URL? - MDN Web Docsdeveloper.mozilla.org · checked 2026-10-25
  7. 07Set-Cookie header - MDN Web Docsdeveloper.mozilla.org · checked 2026-10-25
Questions

Asked a lot.

5 questions people ask next, answered from the sources on this page.

01Is www or non-www better for SEO?

Neither. Google's documentation tells you to pick one preferred URL and redirect the others to it, and it does not favor either hostname.

02Is www a domain name?

It is a hostname label in front of your registered name. MDN's URL guide lists www.example.com as the domain part of a URL, while DNS treats www as a separate name under example.com, so it can have its own records.

03Do I need to redirect www to non-www or the reverse?

Yes, redirect one to the other with a 301 so there is a single version. Google calls redirects a strong signal for choosing the canonical.

04Does Search Console treat www and non-www as separate sites?

A URL-prefix property does, because www.example.com does not match example.com. A Domain property includes all subdomains, www and non-www, and multiple protocols.

05Can I use a CNAME on a root domain?

The DNS standard says a CNAME can't coexist with other data at a name, and the zone apex carries NS and SOA records. Some providers offer CNAME flattening to get around this.

Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly