Htaccess Redirect For Better Pagerank & Other Analytics

.htaccess (hypertext access) redirect is very important to route all the traffic to one form of URL of their blog. It is best to use .htaccess redirect both in the case of humans and bots, as the bots and humans will be handling the URL for various purposes like linkback in case of humans or crawling in case of bots of Google and Microsoft. .htaccess redirect helps in maintaining a single format for your blog or website.

The Different forms of URL can hinder the Pagerank and other analytics, as they would take your blog or website in two different forms and rate it differently. The two most commonly seen formats are with WWW and without WWW , for example ;

http://www.domain.com

http://domain.com

The two formats will be differently handled and hence the linkbacks for humans and the URL for Google bots and Microsoft bots will not appear same. The solution for the above problem is to use .htaccess redirect.

Redirection from with www to without www can be achieved by creating a .htaccess file in your control panel root directory, this will usually be in the public_html in cpanel file manager and similarly in other Control panels like Plesk.

To redirect the with www URL to without www URL, edit the .htaccess file and insert the code given below and save:

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