Skip to content
Free website migration on every plan, done by our team.Learn more ›
Business

www or no www: which is better for SEO?

Neither www nor the bare domain ranks better. What matters is picking one, redirecting the other with a 301 and using it everywhere. How to choose.

Short answer: Google treats www and non-www the same for rankings. Choose one version, send the other to it with a permanent 301 redirect, and use it everywhere: your links, sitemap, canonical tags and Google Search Console.

yourdomain.com and www.yourdomain.com look the same to people, but technically they're two different addresses. If both show your site, search engines see two copies of every page and have to guess which one to rank. The fix is simple: pick one and redirect the other.

Reasons to choose www

  • Cookies stay contained. Cookies set on the bare domain are sent to every subdomain; on www they stay on the main site.
  • DNS flexibility. Standard DNS doesn't allow a CNAME record on the bare domain, and some platforms and CDNs need one. With www you can always use a CNAME (CNAME vs ALIAS records).

Reasons to choose the bare domain

  • It's shorter, cleaner and easier to say out loud
  • Most hosts and CDNs handle it well, including Cloudflare, which works around the CNAME limit

For most small business sites, either choice is fine. What matters is being consistent.

How to set the redirect

In cPanel you can use Domains, Redirects, or add rules to your .htaccess file. To send www to the bare domain:

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

To send the bare domain to www:

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

In WordPress, set Settings, General so both the WordPress Address and Site Address use your chosen version.

Combine this with your HTTPS redirect so visitors arrive in one step, not a chain (fixing too many redirects).

Check it works

Type all four versions into a browser: http://yourdomain.com, http://www.yourdomain.com, https://yourdomain.com and https://www.yourdomain.com. Every one should land on your chosen address with a single redirect.

Then make sure the rest of your setup agrees:

  • Canonical tags point to the chosen version (canonical tags explained)
  • Your sitemap lists only the chosen version (XML sitemaps)
  • Google Search Console uses a Domain property, which covers both

Switching an existing site

You can switch at any time. Add the 301 redirect, update internal links, canonical tags and the sitemap, and expect a little movement in search results while Google catches up.

Frequently asked questions

Does www vs non-www affect rankings?

No. Neither version ranks better. Problems only come from serving both versions without a redirect, which splits links between two copies of each page.

Which should I choose for a new site?

The bare domain is shorter and fine for most sites. Choose www if you plan to use a platform or CDN that needs a CNAME record on your main hostname.

Do I need SSL for both versions?

Yes. Visitors may type either one, and the redirect itself happens over HTTPS, so your certificate must cover both names. Free AutoSSL certificates on cPanel usually include www automatically.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.