www vs Non-www: How to Pick One and Redirect the Other
www vs non-www explained: why you pick one, which four addresses to cover, and the 307 redirect we found on our own site and changed to a permanent 308.
By TheTextKit TeamPublished

A table of three results about the www redirect of our own site. Before, www sent visitors on with a 307 temporary redirect. After, it uses a 308 permanent redirect. Four address variants are covered.
The www vs non-www question has a short answer: it doesn't matter which you pick, but you must pick one. Choose www.example.com or example.com as your main address, send every other version to it with a permanent redirect, and use that same address in your canonical tags and sitemap. We checked our own site and found the redirect was a temporary 307, which isn't the signal you want, so we changed it to a permanent 308. This guide shows what to cover, how to test it and what Google says.
www vs non-www: which one should you choose?
Google doesn't pick a side. Its guide to consolidating duplicate URLs lists https://example.com/home, https://home.example.com and https://www.example.com as ways to reach one page. It tells you to choose one as the canonical address and to use redirects to send traffic from the others.
Your host may have an opinion. Vercel's documentation recommends www as the primary domain, with a redirect from the bare domain, because it gives Vercel's network more control over incoming traffic and the redirect is cached in visitors' browsers. It says that redirecting www to the bare domain also works, but gives Vercel less control. It also explains that the DNS rules don't allow a CNAME record on a bare domain, which is the technical reason behind its advice.
| Choice | What the sources say |
|---|---|
| Either one | Google: pick one as the canonical address and redirect the rest |
| www as the main address | Vercel's recommendation, for control over traffic |
| Bare domain as the main address | Works, with less control for the host |
We use the bare domain, thetextkit.com. Both are fine for search. What isn't fine is leaving both reachable at 200, so that the same page exists at two addresses.
The four addresses to cover
Every site has four front doors, because each of http and https can be used with or without www. If your main address is https://example.com, the other three should redirect to it, and only the main one should load the page.
| Address | What it should do |
|---|---|
| http://example.com | Redirect to the main address |
| http://www.example.com | Redirect to the main address |
| https://www.example.com | Redirect to the main address |
| https://example.com | Load the page (200) |

A table of the four versions of a website address. http without www, http with www and https with www should all redirect to the main address. https without www is the main address and loads the page.
On the https side, Google says it prefers HTTPS pages over equivalent HTTP pages as the canonical, unless there are problems such as an invalid certificate. A redirect from http to https backs that up. Two hops, such as http://www to https://www and then to the bare domain, still end on the right page. One hop is cleaner, because Google's site move guide notes that chained redirects add latency.
What we found on our own site
We run this site on Vercel, with the bare domain as the main address. When we audited it, the www version of every URL returned a 307, a temporary redirect, to the bare domain. Vercel's documentation says it attempts this redirect automatically, and ours had not been set up by hand. Google's guide to redirects explains why the code matters. A permanent redirect (301 or 308) signals that the target should be canonical. A temporary one (302, 303 or 307) keeps the source page as the one shown in results, though the target may still be indexed if other signals point to it.
We have no evidence that the 307 caused any problem. But it said "might change back" for something we meant to be permanent. So we added www.thetextkit.com to the project in the Vercel dashboard, with a redirect to the bare domain and the status code 308. Then we requested the same addresses again.
| Address | Before | After |
|---|---|---|
| https://www... | 307 | 308 |
| http://... (bare domain) | 308 | 308 |
| https://... (bare domain) | 200 | 200 |

A table of our site's redirects before and after the change. https with www changed from a 307 to a 308. http without www stayed at 308. https without www stayed at 200.
After the change, every checked www page, including the home page, a tool, an article and the sitemap, returned a 308 to the same path on the bare domain. An http://www address took two permanent hops, first to https://www and then to the bare domain, and ended on the right page with a 200.
How to test your redirect
To test a www vs non-www redirect, you need the status code and the Location header for each of the four addresses, without following the redirect. With curl it is one command per address:
curl -I https://www.example.com/
Or run this in Node 18 or later to check all four at once:
for (const url of ['http://example.com/', 'http://www.example.com/', 'https://www.example.com/', 'https://example.com/']) {
const r = await fetch(url, { redirect: 'manual' })
console.log(url, r.status, r.headers.get('location'))
}
Read the result like this. Three of the four should show a 301 or 308 and a Location that points at your main address. One should show 200. Check a deeper page as well, such as /blog/some-post, because some setups redirect only the home page and leave the rest at 200 on both versions. A trailing slash is a separate matter: our site sends /tools/word-counter/ to /tools/word-counter with a 308.
Make every signal agree
The redirect is only one part of the www vs non-www setup, and it is one of three signals. Google's guide lists them in order of influence. Redirects are a strong signal that the target should be canonical, and a rel="canonical" link is also a strong signal. Including a URL in a sitemap is a weak one. They work best when they all name the same address.
| Signal | Strength, according to Google |
|---|---|
| Redirect | Strong |
| rel="canonical" link | Strong |
| Sitemap | Weak |

A table of three signals that help Google pick the canonical address. A redirect is a strong signal. A rel canonical link is a strong signal. Including a URL in a sitemap is a weak signal.
We checked ours the same way. All 119 URLs in our sitemap use the bare domain, and every one of the 119 pages returns a 200 with a canonical tag that points to its own address on the bare domain. You can set the canonical in the Meta Tag Generator and build the sitemap with the XML Sitemap Generator, and our guide to the XML sitemap explains what to put in it.
| Check on our site | Result |
|---|---|
| Sitemap URLs on the main domain | 119 of 119 |
| Pages that return 200 | 119 of 119 |
| Canonical tags pointing at their own page | 119 of 119 |

A table of three checks on our site. All 119 sitemap URLs use the main domain. All 119 pages return 200. All 119 canonical tags point at their own page on the main domain.
When you do not need a Change of Address
If you move to a different domain, Search Console has a Change of Address tool. Google's site move guide says you don't need it for HTTP to HTTPS moves or for changes between www and non-www. A single rule from the other versions is enough. For moving many pages, see our guide to bulk 301 redirects.
Limits
Our test of a www vs non-www redirect covered one site on one host, and Vercel was the only host we changed. Hosts differ in whether they redirect for you, which status code they use and where the setting lives, so read your own host's documentation before you assume the same.
On Apache or NGINX the rule is a few lines in the server configuration, and our Redirect Generator writes path rules, not whole-host rules, so use your host's own setting for the www redirect. We can't see inside Google's index, so we don't claim the 307 held anything back. We only know that a permanent redirect says what we mean.
Frequently asked questions
Is www or non-www better for SEO?
Google does not say one is better. Its guide lists them as different ways to reach the same page and tells you to pick one as the canonical address and redirect the others to it. Consistency matters more than the choice.
Should a www redirect be a 301 or a 307?
A permanent one, 301 or 308, when you have decided on the final address. Google treats 301 and 308 as permanent, which signals that the target should be canonical, while a temporary redirect keeps the old address as the one shown.
Do I need a Change of Address request for www?
No. Google's site move guide says you don't need a Change of Address request in Search Console for an HTTP to HTTPS move or a change between www and non-www.
How do I test a www redirect?
Request the four versions of your address, http and https with and without www, without following redirects, and check the status code and the Location header of each. Only one should return 200.
Does Vercel redirect www automatically?
Vercel's documentation says that if a visitor uses your domain with or without www it will attempt to redirect automatically. You may still want to add the redirect yourself so you control its status code.
Check your redirects now
Use the Redirect Generator for page-level rules, and check the whole-host redirect with the four requests above. Everything in our tools runs in your browser, so nothing you type is uploaded.


