Stop Spreading Your Google Juice, Better Known as Link Fragmentation

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!

No comments

Commenting is closed

Top

nGen Extras
The Danger Room

The Danger Room is the design blog/playground of nGen Works

Visit Site »

Recently In The Danger Room
Enjoy Design.
Some of Our Clients
Some of our clients: Chase Manhattan, Century 21, Venus Swimwear, AIGA, Armor Holdings, Macquarie, Bubba Burgers, Bono’s Pit Bar-B-Q, MOCA Jacksonville