Whenever I see blogs that are not properly indexed by search engines because of something as easy to fix as this, it makes me a little sad. What many aren't aware of is the fact that if you don't specify whether or not you want your URL to be with or without the www, you are effectively diluting your effectiveness to the search engines. This is search engines can actually treat your domain as two seperate sites, one site being the URL with the www, and the other being just
yourdomain.com withou the www infront of it.
Many people are a bit confused about this, and find it hard to understand exactly how this works, and why the www even exists if it doesn't server any purpose, and I don't blame them. The truth is that the www did have a purpose in the early days of the internet. The www sub-domain was used to specify in the browser that you were browsing a website through the
http:// protocol, as oppsed to for instance
https:// or
ftp://. These days however, as good as all browsers automatically assume the http:// protocol when you type in a domain without specifying it in the URL field, like for instance bloggst.com, and this leaves little purpose left for the www subdomain.
There even exists organizations out there fighting for complete removal of the www, and you can read more about this topic there should you be interested. This is not all that important however, because what matters is that you are consistent with your URL, choose the one you prefer and stick with it. Here at Bloggst, we run without the www version, mostly for cosmetical reasons. If you prefer your domain to include the www, then that won't have any other effects as long as you stick with it.
Once you have decided on whether you would like the www or not for your domain, you need to take a few simple steps to make sure that the version of your domain that you chose is the one that is being used. The simplest and most effective method of doing this, is through a 301-redirect specified in your .htaccess file. If that sounds confusing, don't worry. All you need to do is to create a new text file, and include a few lines, upload it, and you will be set.
If you want to have your URL displayed without the www, you should include this in your .htaccess file:
Quote:
|
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^bloggst\.com [NC]
RewriteRule ^/?(.*)$ http://bloggst.com/$1 [L,R=301]
|
Of course you will need to replace bloggst.com with your own domain name. Similarly, if you want to include the www in your domain and make sure that all access to your blog goes through the www version, include this in your .htaccess file:
Quote:
|
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.bloggst\.com [NC]
RewriteRule ^/?(.*)$ http://www.bloggst.com/$1 [L,R=301]
|
And that's all there is too it. Once you have saved your file, upload it to the root directory of your domain, and all requests will now be redirected to the www or non-www version, depending on which redirect statement you chose. Please note that this method of redirection requires that mod_rewrite is enabled by your host. If it doesn't seem to work, get in touch with your host to find out if they can enable mod_rewrite.
If all of that seemed a little to complicated for you however, and you're a WordPress blogger, you can always settle for the
No WWW plugin that is available. This will automatically remove the WWW part of your URLs through WordPress.
Additionally it can be beneficial to utilize the
Google Webmaster Tools where you can also specify the desired version of your domain, and tell Google to treat both the www and non-www as the one you prefer.
If you follow these simple yet effective steps, you will be able to ensure that your blog is not being punished in the search engines by being treated as two different websites, so it is not being negatively impacted by a fragmentation of links across yourdomain.com and
www.yourdomain.com. It only takes a few minutes of your time, and should be followed by every blogger out there who hopes to achieve decent ratings in the search engines.