With or without www? Which to choose for your website

Why use www. to access your website?

11 Oct

With or without www? How to choose your website’s address

One of the oldest debates on the world wide web (the WWW) is whether a site should open with www. or without it. On one side are those who prefer www.yourdomain.com; on the other, those who prefer the naked domain: yourdomain.com.

In this guide we explain what changes technically with each option and which one we recommend for a business site. Spoiler: the most important thing is to choose one and redirect the other.

In 30 seconds

  • Without www it looks cleaner, but with www you get more technical room to grow.
  • With www you can use CNAME records, which many cloud services and content delivery networks (CDNs) need.
  • With www your cookies stay better isolated from your subdomains.
  • For SEO it doesn’t matter which one you choose, as long as the other version redirects with a 301.

Our position

If you don’t want to read the whole article, here’s the short answer: for a business site we recommend using www.yourdomain.com. It’s what we do on our own site, www.damos.co. But it isn’t a whim: below we explain the technical reasons.

Without www is cleaner and nicer

It’s true: yourdomain.com is shorter and easier to read than www.yourdomain.com. You can use whichever version you prefer, as long as you stick with it over time. But your site should also be ready for the future, and the future is about performance, security and flexibility.

With wwwWithout www
LookLonger.Shorter and cleaner.
DNS recordsSupports CNAME.Needs A records, or ALIAS/ANAME if your provider offers them.
CookiesStay isolated on www.If set for the domain, they travel to every subdomain.
SEOThe same in both cases, if you choose one version and redirect the other with a 301.

Scalability

If you have a website for your business, it’s because you expect it to grow with it. We call that scalability: your site’s ability to handle more demand without losing performance.

When a site grows, it’s common to move it to cloud services, content delivery networks (CDNs) or web application firewalls that spread the traffic and protect it against spikes or abusive traffic. Many of those services ask you to point your domain with a CNAME record, because that way they can change their servers without you having to touch anything.

The problem is that the root domain (yourdomain.com) usually can’t have a CNAME. According to Heroku’s documentation, subdomains like www always use CNAME, while for the root domain an A record isn’t enough because it requires a static IP: you need ALIAS or ANAME records, and not every DNS provider offers them.

With www you avoid that limitation from day one. And redirecting the root domain to www is simple: it’s done in your hosting panel or with a rule in the htaccess file of your Apache server.

Cookies, performance and security

Cookies

One way to optimize a site is to serve static content (images, CSS, JavaScript) on a subdomain, for example cdn.yourdomain.com. If your site’s cookies are set for the whole domain, the browser also sends them to that subdomain with every request, even though it doesn’t need them.

If your site lives on www.yourdomain.com, its cookies stay on www and don’t travel to cdn or your other subdomains, unless you set it up that way on purpose.

A matter of performance

Sending unnecessary cookies with every image or static file adds weight to requests and can affect caching and load speed, and with them your users’ experience.

If you still prefer the domain without www, you can serve static content on a separate domain, as some large sites do, or use a CDN that handles it.

It’s about security

For the same reason, if your site keeps users’ sessions in a cookie set for the whole domain, every subdomain receives it. If any of your subdomains (shop, intranet, cdn…) is run by a third party or poorly protected, that cookie could be exposed.

Using www.yourdomain.com as your main address reduces that risk, because cookies stay isolated on www.

More flexibility

The good news is that the cookie standard (RFC 6265) lets you share a cookie across subdomains when you do need it, by setting it explicitly. So with www you lose nothing: you decide what’s shared and what isn’t.

What really matters for SEO

For Google, www.yourdomain.com and yourdomain.com are two different addresses. If both show the same content, you have duplicate content. That’s why, according to Google’s guide on how to consolidate duplicate URLs, you should indicate which one is the main version.

Checklist to get it set up right

  • Choose a main version (with or without www) and use it everywhere: links, ads, email signatures and social media.
  • Redirect the other version with a 301 redirect, including http and https.
  • Use canonical tags pointing to the main version.
  • Check in Google Search Console that the indexed version is the right one.
Common mistake: switching versions without 301 redirects. That can make you lose positions on Google while the search engine reindexes your site.

Conclusion

You can’t predict which address your customers will type into their browser, but you can make sure both work and lead to the same place. Without www looks nicer; with www your site is better prepared to grow.

At Damos we set up your site’s domain, redirects and SSL certificate as part of our business web hosting. If your site opens in two different versions or you don’t know which one is indexed, check our hosting plans with technical support and we’ll help you get it right.

Does your site open the same with and without www?

Frequently asked questions

Is it better to use www or not on my website?

For a business site we recommend www, because it allows CNAME records and isolates cookies better. Without www also works, as long as you choose one version and redirect the other.

Does using www affect SEO?

No, as long as you have a single main version. What does affect it is having both versions with the same content and no 301 redirect, because Google sees them as duplicate content.

What is a naked domain?

It’s the domain without a subdomain, for example yourdomain.com instead of www.yourdomain.com. It’s also called the root or apex domain.

Why can’t the root domain have a CNAME record?

Because of DNS rules, the root domain needs other records that can’t coexist with a CNAME. That’s why some providers offer special records such as ALIAS or ANAME.

How do I redirect the version without www to the version with www?

In your hosting panel or with a 301 redirect rule on the server. If your hosting is with Damos, our support team sets it up.

Want your domain set up right?

We review your redirects, your SSL and the version Google has indexed.

Let’s talk

Sources: text based on an article by itdo.com, rewritten and expanded by DAMOS Soluciones · Heroku, Custom Domain Names · Google Search Central, consolidate duplicate URLs · RFC 6265 (HTTP cookie standard).

REQUEST MORE INFORMATION ABOUT OUR SERVICES

Te asesoramos en línea
Elija un departamento
Asesor whatsapp Mayra Castañeda
Mayra Castañeda
Comercial
En línea
Asesor whatsapp Nydia Duarte
Nydia Duarte
Billing
En línea