Home > Boost Your Rank, The Basics > Using www. Could Be Decreasing Your Rank

Using www. Could Be Decreasing Your Rank

February 20th, 2009 Leave a comment Go to comments

If you’ve used WebsiteGrader, you might’ve noticed the section mentioning that you need to redirect www.yoursite.com and yoursite.com to the same location. I’ve done my research on the effects of not doing this, but there are a lot of conflicting opinions. The general though is that your search engine score might be split between the two “seperate” sub-domains.

There is a chance that other problems can be caused also. SSL certificates are for one sub-domain only (with or without the www.), so your certificate might show the user an error if they use the other.

Some search engines may realize they are the same website, others may not, but why risk lowering your score, when it’ll take you less than 5 minutes to fix this problem?!

How to make www.yoursite.com and yoursite.com the same site

If you read my article on Flat Links, you might’ve visited the article “more .htaccess tips and tricks..“. To make www.yoursite.com redirect to yoursite.com (or vise-versa), we’ll again be using some “Apache .htaccess tricks.”

All you need is access to your webserver’s .htaccess file. If you have never heard of this file, you probably shouldn’t be playing with it. Even if you do know what you’re doing, you should make a backup before making any modifications. I mean it! One character out of place and your website might not work anymore!

If you want to loose the “www.” (your website will be http://your…)

Add the following code to the top of your .htaccess file, replacing yoursite.com with your domain name:

RewriteCond %{HTTP_HOST} ^www.yoursite.com$ [NC]
RewriteRule ^/?(.*)$ “http\:\/\/\yoursite\.com\/$1″ [R=301,L]

If you want to keep the “www.” (your website will be http://www.your…)

RewriteCond %{HTTP_HOST} ^yoursite.com$ [NC]
RewriteRule ^/?(.*)$ “http\:\/\/www\yoursite\.com\/$1″ [R=301,L]

IMPORTANT: You must keep all backslashes (\) intact!

The [NC] means not case-sensitive.

[R=301,L] means redirect, code 301. The 301 redirect tells search engines that this page has permenarly moved. The L just means this line is the last rules in this rewrite condition set.

This code will also do a wildcard redirect (redirect the full URL). So if you’re using the first code and someone uses the URL http://www.yoursite.com/help.html, the help.html page will be included in the redirect. So the browser will redirect to http://yoursite.com/help.html.

Let me know how you go!

Related posts:

  1. July 10th, 2011 at 06:16 | #1

    Great post with lots of iomprtnat stuff.

*