Search Engines play an important role in how much traffic web sites get these days and ultimately control the success of your site or not. Search Engines see http://zwhost.net and http://www.zwhost.net as two seperate websites, which can cause you to have duplicate content in the search engine's eyes. So what you want to do is fix that so when a person goes to your website, it automatically transfers them to the www domain.
This is a tutorial on how to redirect you non-www url to the www domain.
Apache:
-> 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.
Select what you want to copy and in doing so you will keep the formatting when pasting it.
-> 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.
-> To be 100% certain this has worked appropriately I suggest visiting this URL and typing in your "non-www" website address into the HTTP Server Header Checker (http://www.automapit.com/headerchecker.html). This tool will show you whether the 301 redirect is being provided by the server. This is what a search engine will see when it visits the site. The result should look like the following areas:
Select what you want to copy and in doing so you will keep the formatting when pasting it.
-> If the redirect worked you are done! Congratulations.
If this has not worked you need to restore the backup you made of the .htaccess file to your website. After the backup is restored go back and review the revised .htaccess on your computer, compare the information to the instructions above and make sure there were no mistakes. If no mistakes are found your server may require custom programming which is beyond the scope of this FAQ; please contact your hosting provider for more information.
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.
-> Now add your domain-revised version of the following ASP code to the default home page for http://example.com:
Select what you want to copy and in doing so you will keep the formatting when pasting it.
Note: do not change the spacing or line placement within the above code; place it as is.
-> Once the default page is online first visit your website via http://example.com to ensure the redirect is working. Next check the server headers for http://example.com and make sure you see the following code within #1: "HTTP Status Code: HTTP/1.1 301 Moved Permanently". That code will confirm the 301 redirect is being properly communicated.