Focus on one domain
Why you should be focusing on one domain name for one site
Often you will find yourself buying a domain for your project (eg: example.com), however these days to secure the brand you have to buy all the associated domains (eg: example.net, example.org, example.co.uk, example.info, etc).
I then find that visitors will end up entering the sites at different points from different domains, depending on how they find it, or what they have been told.
The problem with this is its confusing, and its confusing for the user. The solution is to decide on one domain name, and focus on that, then simply redirect all traffic from the other domains to your main domain name.
This will also help enforce your brand name by ensuring the user always gets redirected to the correct domain, even if they visit the others by mistake.
In addition to this, Google states “Don’t create multiple pages, subdomains, or domains with substantially duplicate content.“, therefore by redirecting traffic to one domain, rather than having duplicates you stand more chance of your domain not being marked as “bad” by search engines. (Also see What’s a preferred domain?)
On a very similar note, another common problem is the “www.” prefix on domains, sometimes people include when visiting a URL, other times they do not. The problem with this is that “www.example.com” is considered an entirely different domain than “example.com” by search engines. By redirecting traffic that is NONE “www.example.com” we can still continue our focus and maintain our brand name.
How?
One method of achieving this (providing you use Apache as your web server) is by using mod_rewrite, and simply placing some code into a “.htaccess” file in the root of your website directory.
Apache mod_rewrite (.htaccess)
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^/(.*)$ http://www.example.com/$1 [R=301,L]
Note: You can also add the QSA flag, which will append the query string to the rewritten URL.
You can also do it in Microsoft IIS, but this is completly untested.
IIS mod rewrite using ISAPI filter (mod_rewrite.ini)
1: Debug 0
2: Reload 1000
3: RewriteCond Host: !^www\.example\.com
4: RewriteRule ^/(.*)$ http://www\.example\.com/$1 [I,RP]
This is a very useful Search Engine Optimisation (SEO) tip.