Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Maximize your site's Google PageRank using a 301 Redirect

Mike Peters, 10-03-2006
One of the simplest most often overlooked steps you can take to maximize your site's PageRank (and your position on the search engine results page a.k.a SERP), is to implement HTTP 301 redirect, sending visitors to "yourcompany.com" to "www.yourcompany.com"

Most web servers (therefore most web sites) are configured to show the same content whether visitors request a page with or without the www in the address. So http://example.com is likely to give you the same content as http://www.example.com

If your website does this, that’s not good, because you are showing the same content to the search engines under more than one URL. In other words, your site is serving up duplicate content. You may be hurt with Google's duplicate content penalty - reducing your PageRank significantly. Additionally, the non-WWW vs. WWW could cause parts or all of your web site to end up in the dreaded Supplemental Index.

In addition - if you have inbound links pointing to both the www and non-www you may get ranking weight and Pagerank vote to both your non-www and your www sub-domains. This would divide your ranking weight and Pagerank to two.

Although it can make a major difference, implementing a 301 redirect only requires two simple steps:

1) Log into your web site's file manager and look for a file called .htaccess. If you are unable to find this file, you can simply create and open it.

2) Once your .htaccess is open and ready for you to edit, copy the code below and paste it into your own .htaccess file:

Quote:
Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} !^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

After you have pasted in this code, change the two occurrences of yourdomain to your actual domain name. Once you save the file, the non-WWW version of your web site will no longer exist to Google, and you will be able to maximize your PageRank and avoid any other potential negative issues.

Mike Peters, 05-24-2007
Chris Hooley wrote a good follow-up on this topic, showing there are typically 8 variations to your home-page and not just 2 as listed above.

All more good reason to setup an HTTP 301 redirect.

If you're using PHP, Our friends from RagePank blogged about how to disable PHPSESSID getting added to your URLs - another trigger of duplicate content and loss of link quality.

Most of the sites we design rely on PHPSESSID/cookies to store session related information. Tossing the nifty power of session variables was not an option, but we didn't want to hurt the sites on the SEO front.

So we came up with a more elegant solution.

Here's the code we use on all sites, to determine whether or not PHPSESSID should be stripped from the URL -

// We're going to allow PHPSESSID in the URL, only if -
// 1. PHPSESSID is NOT set as a cookie, AND
// (
// 2. User is logged in , OR
// 3. User has items in his shopping cart
// )
if (empty($_COOKIE['PHPSESSID']) &&
(!empty($_SESSION['logged_in_user_id']) || $countItemsInCart>0 ))
// We're good
{
// Allow PHPSESSID
}
else
{
// Internal function to connect to database
db_connect();

// If the session we were given with is invalid,
// (Leftover from the search engines incorrectly
// indexing our pages with ?PHPSESSID)
$Result = @mysql_query("SELECT session_key FROM sessions where session_key="".
addslashes($HTTP_GET_VARS["PHPSESSID"]).""");
$Row = @mysql_fetch_row($Result);
if (empty($Row[0]))
{
$pos = strpos($REQUEST_URI,"?");
if ($pos>0) $REQUEST_URI = substr($REQUEST_URI, 0, $pos);

// Strip PHPSESSID and Redirect
// (replace softwareprojects.com with your domain)
Header("Location: http://www.softwareprojects.com$REQUEST_URI");
die;
}
}

Udaipur hotels, 10-27-2010
thanks for info
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions