# 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.

Canonical: https://scaplet.com/glossary/www-vs-non-www

Glossary Glossary · Crawling and indexing

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fwww-vs-non-www%20(%22www%20vs%20non-www%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fwww-vs-non-www%20(%22www%20vs%20non-www%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fwww-vs-non-www%20(%22www%20vs%20non-www%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fwww-vs-non-www%20(%22www%20vs%20non-www%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 4 parts, 4 minutes.

1. [Does www vs non-www matter for SEO? 01](#does-www-vs-non-www-matter-for-seo)
2. [What actually differs 02](#what-actually-differs)
3. [Pick one and redirect the other 03](#pick-one-and-redirect-the-other)
4. [Common mistakes 04](#common-mistakes)

_01_Explained

## 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](/glossary/canonical-url) tags and sitemap entries, which stack with it.

_02_At a glance

## What actually differs

Topic

### DNS alias

www.example.com

A CNAME works, so you can point it at a host

example.com (apex)

A CNAME can't share the name with other records; you need an A/AAAA record or a provider feature

Topic

### Cookies

www.example.com

A cookie without a `Domain` attribute stays on that host only

example.com (apex)

A cookie with `Domain=example.com` is sent to the domain and all its subdomains

Topic

### Certificate

www.example.com

Cover the exact name or use a wildcard

example.com (apex)

Cover the apex name too, or the redirect to www will show a warning

Topic

### [Search Console](/glossary/google-search-console)

www.example.com

A Domain property covers both

example.com (apex)

A Domain property covers both

RFC 1034 says that "If a CNAME RR is present at a node, no other data should be present." The top of a zone also carries NS and SOA records, so the apex normally can't hold a CNAME. Some DNS providers work around it: Cloudflare's CNAME flattening, for example, "allows you to use a CNAME record at your zone apex" by returning the final IP address instead. Check what your host and DNS provider support before choosing.

On cookies, MDN says that setting `Domain` makes a cookie available to that domain and all its subdomains, and that omitting it makes it a host-only cookie. If you serve static files or an app from other subdomains and want shared cookies, the apex setup can be simpler. If you want to keep site cookies off a cookie-free asset subdomain, www can be simpler. This is a design trade-off, not a Google rule.

_03_How 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](/glossary/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; }
```

_04_Worth 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. 01 [Redirects and Google Search](https://developers.google.com/search/docs/crawling-indexing/301-redirects) developers.google.com · checked 2026-10-25
2. 02 [What is canonicalization and how to consolidate duplicate URLs](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls) developers.google.com · checked 2026-10-25
3. 03 [Verify your site ownership: property types - Search Console Help](https://support.google.com/webmasters/answer/34592) support.google.com · checked 2026-10-25
4. 04 [RFC 1034: Domain names - concepts and facilities](https://www.rfc-editor.org/rfc/rfc1034) rfc-editor.org · checked 2026-10-25
5. 05 [CNAME flattening - Cloudflare DNS docs](https://developers.cloudflare.com/dns/cname-flattening/) developers.cloudflare.com · checked 2026-10-25
6. 06 [What is a URL? - MDN Web Docs](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_URL) developer.mozilla.org · checked 2026-10-25
7. 07 [Set-Cookie header - MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie) developer.mozilla.org · checked 2026-10-25

Questions

## Asked a lot.

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

_01_ Is 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.

_02_ Is 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.

_03_ Do 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.

_04_ Does 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.

_05_ Can 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.

## Keep learning

[All glossary](/glossary)

[Learn HTTPS Crawling and indexing](/glossary/https) [Related Google Search Console Crawling and indexing](/glossary/google-search-console) [Read next A record (DNS address record) Crawling and indexing](/glossary/a-record) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[White paper](/glossary/white-paper) [Word count](/glossary/word-count) [x-default](/glossary/x-default)

More in Crawling and indexing
[SSR vs CSR](/glossary/ssr-vs-csr) [Subdomain vs subdirectory](/glossary/subdomain-vs-subdirectory) [Trailing slash in URLs](/glossary/trailing-slash) [unavailable_after](/glossary/unavailable-after) [URL fragment](/glossary/url-fragment) [URL Inspection tool](/glossary/url-inspection-tool) [URL parameters](/glossary/url-parameters) [URL structure](/glossary/url-structure) [User agent](/glossary/user-agent) [Video sitemap](/glossary/video-sitemap) [Web crawler](/glossary/web-crawler) [Web scraping](/glossary/web-scraping) [www vs non-www](/glossary/www-vs-non-www) [X-Frame-Options](/glossary/x-frame-options) [X-Robots-Tag](/glossary/x-robots-tag) [XML sitemap](/glossary/xml-sitemap) [301 redirect](/glossary/301-redirect) [302 redirect](/glossary/302-redirect) [410 Gone](/glossary/410-gone) [A record (DNS address record)](/glossary/a-record) [Bing Webmaster Tools](/glossary/bing-webmaster-tools) [Bot management](/glossary/bot-management) [Broken links](/glossary/broken-links) [cache: search operator](/glossary/cache-search-operator)

Terms on this page
[Canonical URL](/glossary/canonical-url) [Google Search Console](/glossary/google-search-console) [HTTPS](/glossary/https)

Free · 2 minutes

## Know the term. _Now check your site._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
