How to Redirect From Non-WWW to WWW Domain

Did you know search engines consider http://domain.com and http://www.domain.com two different websites? Most people are completely unaware of this and they end up splitting the potential benefit of valuable links, resulting in your site ranking lower and being less visible.

Let’s use an example for this…

Tom has a car wash. His website is http://www.TomsCarWash.com. However, if you go to http://TomsCarWash.com, the same site is pulled up. Tom is not using a 301 redirect.

Why is this bad? Well, again, search engines look at this like they are two different sites. This is bad because a major factor of SEO and optimizing your site is by having a lot of quality backlinks. So let’s assume there are 100 sites that link back to Tom’s website.

70 of those sites link to this website – http://www.TomsCarWash.com.
30 of those sites link to this website – http://TomsCarWash.com.

Tom SHOULD have a total of 100 backlinks. Instead, he actually only has 30 on the non-WWW, and 70 on the WWW version. Again, backlinks are a huge factor when trying to get a site ranked higher in the search engines.

So, Tom did a bunch of work to get these sites to link back to his site, but all that work he did isn’t really paying off. What Tom needs to know is set up a 301 redirect so that when someone types in http://TomsCarWash.com, they are automatically redirected to http://www.TomsCarWash.com.

Now if this is done as a 301 redirect, then all of the backlinks he has to http://TomsCarWash.com will count for http://www.TomsCarWash.com. A 301 redirect basically tells search engines “Hey, our site is actually http://www.TomsCarWash.com”.

How To Do a 301 Redirect From Non-WWW to WWW Site

In order to 301 redirect your non-WWW site to your WWW site, just log into your FTP account and go to the folder that contains all your website files. Go ahead look for a file named “.htaccess”. Edit/Download that file onto your computer and open it with Notepad.

Add the following lines to your .htaccess file:

RewriteEngine On

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

Just be sure to replace “yourdomain.com” with your actual domain.

I Don’t Have An Htaccess File. Now What?

If you do not have an htaccess file in your site folder, then simply open up Notepad, copy and paste the code above, replace “yourdomain.com” with your actual domain, and then save that Notepad file to your Desktop as “htaccess”.

Now go back to your FTP program and upload “htaccess” to your site. Once you’ve uploaded that file, just simply right click on the file name, go to Rename, and type “.htaccess” (without the quotes). Notice the ‘period’ before the htaccess. That’s VERY important.

And now you have successfully redirected your non-WWW site to your WWW site. This is one of the first steps that we do when optimizing our client’s websites.

Leave a Reply

  • (will not be published)