setting-prefered-domain

One of the many things I check upon while doing an SEO audit is whether the website of the client has a preferred domain or not. In almost all cases, companies develop their websites, upload it and then forget it. They don’t bother about indexation, site health or anything else. Well, that’s where we come in.

Preferred Domains

A website can have a URL in any of the following versions:

http://www.website.com or http://website.com

These are the www or non-www versions and very often freshly deployed websites have both. Meaning a visitor could type in any of the addresses and would get served the same content. Not quite a problem one could think, but it is quite a big deal for reasons affecting search engine optimization and usability.

For example, a user may log in from the ‘non-www’ version and follow a link to the ‘www’ version. He/she would probably have to log in again if the developer hasn’t accounted for that and they usually don’t.

From an SEO point of view, having both versions is seriously problematic. Indexation is the main issue here because Google treats the two versions as two different websites (Yes, even if the content is the same). Technically the ‘www’ denotes a sub-domain and it can point to different content and in rare cases, the content is actually different. So Google must not make assumptions and their algorithms must account for as many technical possibilities as possible.

As such, search engines index ‘www’ and ‘non-www’ versions of a website separately. A simple way to check if Google has indexed two versions of your website, type in the following queries in Google Search: site:http://mywebsite.com and site:http://www.mywebsite.com.

Normally both should return the same result and the same number of results, but not if the search engine has indexed two versions.

Link Juice Dilution

It’s the main issue when dealing with this kind of situation. Let’s say all of your social profiles link to https://kingz4d.com but a high authority blog makes reference to your website and links to http://yourwebsite.com. The link juice coming from the later would be lost as you are actually using the ‘www’ version for your link building campaigns.

It is imperative to set a preferred domain to avoid these problems and the preferred domain is also the version that you want used for your site in the search results.

Setting Preferred Domain on Google Webmaster Tools

The webmaster tools provide webmasters a way to chose their preferred domain for future indexation and would display the preferred URL in search engine results. A complete help section is dedicated to this here:

A 301 Redirect

Most often, I only write a 301 redirect in the .htaccess file (Note: the .htaccess is only available on servers running apache). It’s simple, effective and quick. The code used below is for redirection from the ‘non-www’ version to the ‘www’ version.

#Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]

For example, this is the exact piece of code that exist on our .htaccess file which we use to redirect the ‘non-www’ version to the ‘www’ version:

#non-www to www 301 redirection
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.os-omicron\.org$
RewriteRule (.*) http://www.os-omicron.org/$1 [R=301,L]

www to non-www redirection

It also happens that one might like the URL without the ‘www’. I use this redirection when the hostname is long and therefore adding four more characters to it is unnecessary.

#Redirect www urls to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*) http://example.com/$1 [R=301,L]

Personally, I think hostnames without a “www” are kind of a nod to web fashion. The first major website which I noticed didn’t bother to add the “www” was Twitter. Speaking of which, If you want you can follow us here: