| SiteProNews Blog |
| SiteProNews has launched the SiteProNews Blog for webmasters. Drop by to read regular posts by two of the Web's top writers, Jim Hedger and Jerry Bader. |
Originally published in SiteProNews, May 11, 2007
The Problem
Search engines consider http://domain-name.com and http://www.domain-name.com different websites. As a result, if your website has been linked to from other websites using a mix of the two URLs you are effectively splitting the potential benefit of valuable link popularity.
The Solution
Using a 301 redirect on the "non-www" version of the URL, which is essentially a "permanent" redirect in server talk, you can effectively consolidate all of your link popularity to a single URL. This consolidation will serve to increase your website's chances of obtaining and maintaining top rankings.
How To Enable The 301 Redirect
You need to instruct the server you are hosting your website on to redirect the traffic seamlessly. To do this you need to first establish what type of server your website is hosted on. There are two main types of servers that are in use: Microsoft and Apache (Linux/Unix). Once you have established the server type you need to follow their related instructions below. Please note this is best left to a person with some technical knowledge.
A) Installing the Non-WWW 301 Redirect on a Apache Server
Ensure that your hosting provider has the Apache Rewrite Module turned on; this is a definite requirement for this fix to work. In most cases your hosting provider will not have a problem enabling the module if it isn't already enabled (it seems to be on in most circumstances).
If you have access to the httpd.conf file on your server then you can actually enable the module yourself. Open the httpd.conf file, back it up somewhere in case of error (you cannot be too safe) and then uncomment the following line:
LoadModule rewrite_module modules/mod_rewrite.so
Once the line is uncommented, save the file and restart the server then proceed with the following steps.
Download the .htaccess file from your website's root web folder to a folder on your machine where you can edit it.
Make a copy of the .htaccess file and save it somewhere else for safe keeping in case you need to revert to the old version - do not edit this version.
Open the original .htaccess you downloaded in Notepad
Add the following code (in red) into the .htaccess file. Be sure to substitute "example.com" with your own website information but touch nothing else.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Upload the file back to your website in the exact same place you downloaded it.
Once the upload is complete open a browser and try visiting the "non-www" version of your website address. If the .htaccess is working as it should you will be redirected immediately to the proper "www" version of your website. This will be reflected in your browser's address bar.
#1 Server Response: http://example.com
HTTP Status Code: HTTP/1.1 301 Moved Permanently
Date: Wed, 14 Mar 2007 22:49:28 GMT
Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
Location: http://www.example.com/
Connection: close
Content-Type: text/html; charset=iso-8859-1
Redirect Target: http://www.example.com/
#2 Server Response: http://www.example.com/
HTTP Status Code: HTTP/1.1 200 OK
Date: Wed, 14 Mar 2007 22:49:28 GMT
Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
Connection: close
Content-Type: text/html
...............
B) Installing the Non-WWW 301 Redirect on a Microsoft IIS Server
Microsoft servers do not have a .htaccess file to alter so we suggest that you contact your hosting provider and request they make this change for you. If they are baffled or need further instructions on how to make the changes you can refer them to the tutorials referenced below:
Using Internet Services Manager create a new IP-based website using the http://example.com URL or alternatively you can avoid using a unique IP by using the host header (virtual website) of www.example.com.
Now verify the server headers for each website using the Server Header Checker. The server response should be 200 OK for both addresses.

Ross Dunn is the founder and CEO of StepForth Search Engine Placement. Celebrating its 10th year in operation, StepForth is one of the oldest and most trusted brands in search marketing. Ross regularly publishes tutorials on SEO tips and techniques at the StepForth SEO Blog and at SiteProNews.com

Copyright © 2007 Jayde Online, Inc. All Rights Reserved.
SiteProNews is a registered service mark of Jayde Online, Inc.
| Jayde Online Network Sponsored Ads |
|
|
|
|