1

TLDR: should I redirect www -> nowww or vice versa? Also should I do in dns file using CNAME or in HTTP Server?

I want my website to be accessible as both www.example.com and example.com May I know if there are any preferences in SEO over using www vs no-www?

I understand that I should have only one canonical url, www or no-www. May I know where is it best to do the redirection? Options that I have:

  1. DNS record file.

    1. Direct no-www to ip
    2. CNAME record pointing www to no-www

    (not sure if possible to direct www to ip and CNAME no-www to www)

  2. web server 301 redirect www to no-www or no-www to www

(Not sure if there any other ways). May I know what's best for SEO? I hope the best practices are standard and this question doesn't count as opinion based.

2

As you can see here on the Support Google-Page there is no benefit of having it either with www or without, but you should stick with the one you decide to have. Also you should have the right settings in the Google Webmaster Tools, and use 301 redirects and/or canonicalisation to your prefered one, just as you already said. (I think in case of 301 Redirects there is no canonicalisation needed, except for maybe some duplicate pages you might have).

1

It depends on how you deal with cookies on your site. If you use the www version of your website and then store cookies in the www version then you can have a subdomain on your site for asset storage such as images. The advantage is that you don't need to pass cookie information to the asset subdomain at all, thereby saving bandwidth and upping your score in the gtmetrix.com tests.

If however you use just the domain name without the www and you use cookies, then requesting asset URLs regardless of subdomain will require cookie information to be passed to it.

Visit this site if you need another explanation:

http://gtmetrix.com/use-cookie-free-domains.html 

If however your site is meant to be simple where users settings don't affect site operation (for example, you don't use login pages), then the above won't apply so much to you, but given the dynamic nature of the web, the above applies to many people.

Also, make sure you 301 redirect the incorrect version of your main URL to the correct version to make your site compatible with more search engines, especially ones that don't support rel="canonical".

  • I appreciate your answer and your information about cookie and I upvoted you, however, for posterity, I must point out that only the last paragraph is related to SEO. – 0fnt May 7 '15 at 1:21
  • Google takes speed into consideration when ranking results and if extra data has to be sent down the wire, then more bandwidth is necessary to process the request which results in a somewhat slower experience. – Mike May 7 '15 at 6:44
  • That's a great point, want to add to the original answer? – 0fnt May 8 '15 at 11:10
1

Okay, so this is a very interesting question. There are even websites that discuss this: http://no-www.org/ and http://www.yes-www.org/.

http://www.yes-www.org/ has a page 'Why use www?'. From their website:

You should use www because today you have a small web site, and tomorrow you want a big web site. Really big.

The technical reasons to use www primarily apply to the largest web sites which receive millions (or more) of page views per day, web sites with a large number of services across several subdomains, and virtually any web site hosted in “the cloud” by an application service provider.

Heroku, for instance, strongly recommends against using naked domains. When using a provider such as Heroku or Akamai to host your web site, the provider wants to be able to update DNS records in case it needs to redirect traffic from a failing server to a healthy server. This is set up using DNS CNAME records, and the naked domain cannot have a CNAME record. This is only an issue if your site gets large enough to require highly redundant hosting with such a service. But who doesn’t want their site to get that large? In order to not use www, you will have to run your own server farms and you will be unable to use such services to their fullest extent. (See also: Why does Heroku warn against “naked” domain names?)

Another reason has to do with cookies. One common web site optimization is to serve static content from a subdomain, such as static.example.com. If you are using www, then this is no problem; your site’s cookies won’t be sent to the static subdomain (unless you explicitly set them up to do so). If you use the naked domain, the cookies get sent to all subdomains (by recent browsers that implement RFC 6265), slowing down access to static content, and possibly causing caching to not work properly. The only way to get around this problem and keep the naked domain is to buy a second domain name just for your static content. Twitter, for instance, which does not use www, had to buy new domain names just for static content. Of course, if you explicitly share your cookies across all your subdomains, for instance to implement single sign-on across various services on subdomains of your site (Google does this), then you too would have to buy a new domain name in this circumstance anyway. (See also: What’s the point in having “www” in a URL?)

Speaking of cookies, if you decide to use the naked domain, but want to put services on subdomains and share cookies between them, you’ll quickly find out that it doesn’t work right in all cases unless you have a subdomain set the cookie — and then it doesn’t work for the naked domain. The fix for this is to use RFC 6265 (formerly RFC 2965) cookies, which can be shared between the naked domain and subdomains, but some popular web application packages still do not implement RFC 2965 properly or at all, let alone RFC 6265. (See also: Can subdomain.example.com set a cookie that can be read by example.com?)

You may not run into any of these issues today, but as your web site grows, you eventually will. Using www today and in the future makes you more prepared to handle the challenges of growing a web site beyond a single server. It can be done without using www in many circumstances, but it’s much easier with.

As for SEO, there are no benefits of choosing www or no www.

0

If you use Wordpress I think you will only one version (www or without it) as you choose when installing. CNAME record pointing www to no-www will show same content on both.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.