Make sure your DNS is setup for both www and no-www.

One error I’ve seen on a number of sites recently is that they are not setup correctly for both the www and no-www versions of their domain.

One example is newstalk106.ie. Newstalk is a national talk radio station in Ireland. If you go to www.newstalk106.ie you get to their website whereas if you go to newstalk106.ie you get a holding page with an “Under Construction” message. Looking up the DNS info for the domain we can see that the no-www version of the domain points to a different server than the www version. I guess they forgot to update the DNS record when the website went live.

> nslookup newstalk106.ie
Server:         10.2.14.5
Address:        10.2.14.5#53

Non-authoritative answer:
Name:   newstalk106.ie
Address: 195.218.114.18

> nslookup www.newstalk106.ie
Server:         10.2.14.5
Address:        10.2.14.5#53

Non-authoritative answer:
Name:   www.newstalk106.ie
Address: 194.149.76.98

Another error that I’ve seen is where there is no dns record associated with either the www or no-www version of the domain. So going to mydomain.com gives an error whereas going to www.mydomain.com gets you to the page. This error can be hidden for many users because some web-browsers are smart enough to try www.mydomain.com if mydomain.com doesn’t exist. An example of this kind of error can currently be seen at citylink.ie.

> nslookup citylink.ie
Server:         10.2.14.5
Address:        10.2.14.5#53

Non-authoritative answer:
*** Can't find citylink.ie: No answer

> nslookup www.citylink.ie
Server:         10.2.14.5
Address:        10.2.14.5#53

Non-authoritative answer:
Name:   www.citylink.ie
Address: 194.159.243.244

So if you’re developing a web application make sure that you define DNS records for both the www and no-www version of the domain.

Ensuring Canonical URLs

Although you should setup DNS records for both www and no-www versions of your domain, you should only use one of them. Choose which version of your domain you want to use and setup a redirect from one to the other. For example, if you go to aidanf.net you will be always be redirected to www.aidanf.net (the www version had more inlinks when I started redirecting). On other sites I usually redirect to the no-www version (see no-www for arguments on why the www prefix is redundant). This ensures that urls on your site are consistent and you don’t dilute your google-fu by have links to www and no-www versions of the same resource.

One of my previous posts describes how to ensure canonical urls with apache rewrite rules. If you are allowing both www and no-www versions of your pages, you can use google webmaster tools to tell google which version of links to your site is preferred: www or no-www.

I haven't had the time to write this so thanks a million! I'll pass it onto O2 (o2.com) and the guys who designed the site belonging to the association I Chair (bima.co.uk). I'll also write my own post and link to here.

Forgot to mention that we had a debate around www on the W3C Advisory Committee because technically we don't need it anymore. In short, Tim Berners-Lee stated that people are used to seeing it on business cards. Sweet.

*cough* Tribune.ie

Cool..! There are some other issues as well.. like some sites automatically includes the www. in front of ur domain.. and what if the same is not activated? ( the back link checks!)

Nice article.. and examples helps to get an indepth view on the matter.

Its funny, most people who are new or average internet users always seem to use the www prefix where as advanced users simply exclude the www as a means of a short cut or time saver.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
4 + 3 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.