geg2
April 7th, 2007, 05:07 PM
Whenever someone types in "http://domain.com/somedirectory/somepage" , you can easily redirect them to "http://www.domain.com/somedirectory/somepage" OR you can do it the other way around. In any case, you should be consistent with all your URLs.
What does this have to do with SEO? Look around the web and you will find many websites whose PageRank is vastly different for domain.com vs "www.domain.com". How is the search engine supposed to know which URL to rank? By doing a 301 redirect, you remove that possible confusion. Also, by enforcing a consistent URL system, you maximize the PageRank that gets distributed throughout your site from internal and external links.
Below is the code to add to your .htaccess file at the home directory of the website.
First, save a BACKUP copy of your existing .htaccess file. Be sure to change the word DOMAIN into your real domain name and the COM into net, org, us, or whatever your website ends with.
Add the following code to your .htaccess file and upload to the home directory of your website:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
What does this have to do with SEO? Look around the web and you will find many websites whose PageRank is vastly different for domain.com vs "www.domain.com". How is the search engine supposed to know which URL to rank? By doing a 301 redirect, you remove that possible confusion. Also, by enforcing a consistent URL system, you maximize the PageRank that gets distributed throughout your site from internal and external links.
Below is the code to add to your .htaccess file at the home directory of the website.
First, save a BACKUP copy of your existing .htaccess file. Be sure to change the word DOMAIN into your real domain name and the COM into net, org, us, or whatever your website ends with.
Add the following code to your .htaccess file and upload to the home directory of your website:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]