www or no www? Choosing and enforcing one version

Whether to use www.yourdomain.co.uk or yourdomain.co.uk, why you should pick one, and how to redirect the other to it.

Guide2 min readLast updated
On this page
  1. Does it matter which?
  2. Why one version
  3. Making both work
  4. Redirecting to your choice
  5. Common questions

www.yourdomain.co.uk and yourdomain.co.uk are technically two different addresses. Visitors expect both to work, but your site should settle on one.

Does it matter which?

Not for ranking or speed. It’s a preference:

  • Without www is shorter and more common for new sites.
  • With www has a small technical advantage for large sites using cookies and CDNs, and is familiar to less technical visitors.

What matters is consistency: one version, with the other permanently redirecting to it.

Why one version

  • Search engines see a single address for each page rather than splitting signals across two
  • Logins and cookies behave consistently
  • Analytics isn’t split across two hostnames

Making both work

With Traxio nameservers, both yourdomain.co.uk and www already resolve and the SSL certificate covers both.

Redirecting to your choice

WordPress: set the preferred version in Settings → General for both addresses. WordPress redirects the other automatically. How to change your WordPress site URL

Any other site: add a rule to .htaccess. To send everything to the non-www HTTPS version:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://yourdomain.co.uk%{REQUEST_URI} [L,R=301]

Replace yourdomain.co.uk with your domain. Redirects with .htaccess: copy-ready examples has the www version too.

Common questions

Should my site use www or not?

Either works — pick one and make the other redirect to it, so a page never exists at two addresses. Search engines treat www.example.com and example.com as separate sites unless you tell them otherwise.

This is a general web-hosting explanation, not specific to Traxio.

Spotted something out of date or unclear? Tell us and we’ll fix it.

Keep going