
Since this site has been live for all of three hours, I decided to answer a question I receive very often. Hopefully it will save many of you tons of trouble when you get your blogs set-up. While there are several ways to accomplish this, the most effective is in the form of a 301 redirect. There are many reasons to want to get this done. Most importantly, in my opinion, is the fact that Google will actually assign PageRank to both your http:// address *and* your http://www address. This can result in search ranking that is not optimal, and PageRank that is lower than you would otherwise expect, based on your site’s qualifications.
Instead of a long explanation of how it works, I’ll just show you the code to make it happen. Provided that your host has Mod_Rewrite enabled, you should just be able to change the example to reflect your domain name, and add it to the end of your .htaccess file. For more information about this, please feel free to Ask A Question.
To Forward http://domain.com to http://www.domain.com, use the following code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]
To Forward http://www.domain.com to http://domain.com, use the following code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=Permanent,L]
That should do it! Using this method will ensure that your Google PageRank is always the highest number possible, and as a result, can yield increased traffic through search engines.
Don't Miss An Answer! Subscribe To Our Full RSS Feed!

