www vs Non-www: Which Should You Use?

Hosting, Security & Maintenance2 min readBy the Monopage team

Your site can usually be reached at both www.example.com and example.com. They look like the same thing to visitors but are technically different addresses. Choosing one and sending everyone there avoids duplicate pages and keeps your signals together.

Does it matter for SEO?

No ranking advantage is known for either choice. Search engines treat them as separate hostnames, so what matters is consistency. If both versions show the same content without redirects, you create duplicate versions. See duplicate content and SEO.

Pick one

Non-www (example.com) is shorter and looks clean. Many new sites choose it.

www (www.example.com) has some technical advantages. It lets you use a CNAME record at the www level for flexible hosting and CDN setups, and cookies can be scoped more precisely. Some larger sites prefer it for those reasons.

For most small business sites, either works. Pick one, and stick with it.

Make the other redirect

Set up a permanent redirect from the version you do not use to the one you do, for every page, not just the homepage. For example, www.example.com/about should lead to example.com/about. See 301 redirects explained. Your host or CDN often has a setting for this.

Combine with HTTPS

Make sure all four combinations (http and https, with and without www) end up at the single preferred address, ideally in one redirect step rather than a chain. See what is SSL and why HTTPS matters.

Set DNS correctly

Both versions must resolve for the redirect to work:

  • A record or equivalent for the root domain
  • A record or CNAME for www

Some DNS providers support special flattened or alias records for the root domain, which let you point the root to a hosting service by name. See how DNS works for website owners and how to point a domain to your website.

Tell search engines

Changing your preference

If you switch, set up redirects before changing links, and monitor for errors. See how to migrate a website without losing SEO.

What about email?

Email addresses use the plain domain, regardless of which web address you prefer.

Test it

Type all variants into a browser. Each should end at the same final address with a 301 redirect. You can see the codes in developer tools. See HTTP status codes explained for website owners.

Common mistakes

  • Leaving both versions live
  • Redirecting only the homepage
  • Forgetting to set up the other hostname in DNS
  • Using a different version in canonical tags than the one you redirect to

As your configuration grows, record what changed. Read how to keep a website changelog.