Stop Spreading Your Google Juice, Better Known as Link Fragmentation
Posted by: Travis Schmeisser on Monday November 5, 2007
Search engines can often regard “domain.com” and “www.domain.com” as different URLs unless you tell them otherwise. This can spread your Google Juice™ and have some ill effects on your search engine ranking. An easy fix is to setup a permanent redirect from one site to the other.
To permanently redirect your site from “domain.com” to “www.domain.com” use this .htacess rule.
Line breaks are marked with “»”
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ <a href="http://www.domain.com/$1">http://www.domain.com/$1</a> »
[R=301,L]
You can do a simple check for this and other issues with your site for free at Website Grader
For Our Fellow ExpressionEngineers
If you use ExpressionEngine and .htaccess to get rid of index.php from URLs you can add the same code, but rearranged a bit to get the same benefit.
Line breaks are marked with “»”
RewriteEngine On
RewriteBase /
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ <a href="http://www.domain.com/$1">http://www.domain.com/$1</a> »
[R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Now your redirects will work on pages using URL faking as well! Boom!
Filed under: Interweb

No comments