Once in a while I get people calling me saying that their site isn’t showing up at all. One of the first things I do is to check to see whether they have a 301 redirect.

The purpose of a  301 redirect is to direct users (and robots) to another URL. If you move your site to a new domain you can send people to the new domain behind the scenes.

For the most part, search engines look at www and non-www versions of your website as different sites. This is the area we’re going to address. The reason for a website not showing up can be because someone put in ‘www.example.com’ when the domain name was set up to show the website for ‘example.com’ – or visa-versa.

The simplest way to ensure that the website shows for both versions is to put (or change) an .htaccess file in the root of your website – for servers running Apache (common). For other servers, check with your host support. An .htaccess file is a hidden file that can make server configuration changes per directory that it’s in.

Open up a text editor (notepad?) and copy/paste this in, changing the domain name to match your own:

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

Save the file as a .htaccess (don’t forget the ‘.’) and upload to your server (I use Filezilla).

This will force the www. version of your site to be used.

If you want the non-www version of your site to be used change the file to this:

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

Here’s more information from Google Webmaster Tools

And here’s what Wikipedia has to say.

I hope this helps!

 

 

Doug Moore has been helping small businesses grow and succeed for over 10 years. His passion is to provide the tools to help you efficiently market your business.

Facebook
Twitter