Boost Your PageRank with a Quick Fix

In this article I will show you how you can boost your PageRank by implementing two simple fixes, so you website will use a preferred domain. Each fix should only take you one minute to implement… and it is the very first thing I do after setting up a new domain on my web server.

Most websites can be reached via two web addresses. One web address has the www in it, like http://www.eblogcamp.com, whereas the other web address has the www missing like http://www.eblogcamp.com.

In order to have better SEO for your website, you need to pick one domain format and be consistent with it. If you do this, then Google will not give separate PageRank for two URLs that point to the same page.

At this point, you might say… that’s crazy! Aren’t they both the same site!?

But think of it like this. You are running your own hosted blogging platform called “blogmaster.com”. Each blog user will be given a subdomain such as “kirk.blogmaster.com” and “chocolates.blogmaster.com” etc. Now if Google treated all the subdomains as part of the main domain, the PageRank results will be inaccurate. It’s a similar story for www, which is just another subdomain.

Fix #1: Set a Preferred Domain in Google Webmaster Tools

Login to your Google WebMaster Tools account and set the preferred domain. Once you have specified your preferred domain, it may help determine PageRank for your site more accurately since the value of each page will not be split across two domains.

From Google Help:

The preferred domain (www or non-www) is the one that you would liked used to index your site’s pages (sometimes this is referred to as the canonical domain). Links may point to your site using both the www and non-www versions of the URL (for instance, http://www.example.com and http://example.com). The preferred domain is the version that you want used for your site in the search results.

Fix #2: Add a 301 Redirect to the Preferred Domain

After you have set your preferred domain, you need to force all users to use the preferred domain by using a server-side 301 redirect. The 301 status code means that a page has permanently moved to a new location.

You can do this by editing the .htaccess file in the root directory of your domain on the web server. It is usually located at /public_html/domain.com/.htaccess

In my case, I want everyone visiting eBlogCamp to do so with the www in the URL. To force this, edit your .htaccess file and enter the following Apache directives:

# BEGIN 301 Redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^eblogcamp\.com$ [NC]RewriteRule ^(.*)$ http://www.eblogcamp.com/$1 [R=301,L]</IfModule>
# END 301 Redirect

You need to replace “eblogcamp.com” with your domain name. The code above is an Apache directive that redirects all eblogcamp.com to www.eblogcamp.com.

Notes:

  • The redirect code in the .htaccess file only works on Linux web servers running Apache with the Apache Mod-Rewrite module enabled.
  • If you are using a WordPress caching plugin such as W3 Total Cache, make sure that you add these new Apache directives to the very top of your .htaccess file.

How it Works

By having one preferred domain format, you are ensuring link consistency.

For example, if ten sites are linking to your article with a www prefix and another ten sites are linking to the same article without the www prefix, then Google sees the article as actually two pages. Thus the article will not receive the same weighting as having all twenty sites linking to the preferred domain. The .htaccess code ensures that all requests goes to the domain format that you want.

What do you Think?

Did you already have a preferred domain and your .htaccess file configured? If not… did my fixes take you less than two minutes to implement?

15 Comments

  1. For some odd reason, it shows that my site is verfified and all (from what I see). However, when I try to add a preferred domain it says part of the process is verifying I own it. I don’t see where to do that lol. Great tips and if I get it figured out, will definitely be doing, as I don’t think they can make up their mind what my PR should be!

    • Hi Veronica. To have your domain verified by Google, you need to upload the verification file to the root of your website. You only need to do this once, and then verify for the www and non-www variants of your domain name. Very easy to do. Login to Web Master Tools and try it again.

  2. Hi, my question might be quite off topic.

    Which one is better between www or non-www? Which one Google likes more, or are they have the same authority?

    • Hi Affan, it doesn’t matter. Just pick one variant and be consistent with it.

  3. Hi Kirk,
    Once again I’ve learnt another great lesson from one of your articles. I assumed that Google treats “www” the same as having no “www” but your explanation about the website address being a subdomain makes perfect sense!
    Thanks,
    Bob

    • Hi Bob, well Google does treat it the same… it’s just that you want to use one or the other so you don’t split the page rank.

  4. Extremely useful SEO quickfix and step by step instructions. Thanks, Ashley

  5. Hi Kirk,

    If I have my hosting company do a 301 permanent redirect, I still have to use these recommedations?

    I am also using W3 Total Cache plugin.

    Ron

    • Hi Ron, probably not. Just navigate to the www. and non-www versions of your URL and make sure they both redirect to your preferred URL.

  6. You can set WordPress to automatically redirect to either the www version of a domain or the non-www version. So, for WordPress sites, is it also necessary to edit the .htaccess like you suggest?

    • Hi Kathy, in older versions of WordPress you had to update the .htaccess file, but you don’t need to do that anymore.

  7. Hi, Kirk!
    Is that valid for sites (not blogs) too?
    And how can I edit the .htaccess of a site?
    Thanks a lot,
    Fabio

  8. Hi

    Nice article.

    What about for a site over 10 years old that has never specified it before. I am scared i will lose my already good rankings.

    Please advise.

  9. Thank you for sharing this solution on how to fix up .htaccess files. It really helped me to understand what I need to do so my website is classed as two separate sites by Google.

  10. Thank you for sharing this amazing solution on how to fix up .htaccess files.