| Do you have multiple domain names that all lead to the same web site? Valid reasons for doing this include helping visitors who may type a domain name with spelling mistakes, hyphens, no hyphens or confuse different names, as well as preventing competitors and name squatters from using a similar domain name. For a few dollars per year per domain name, it often makes sense to buy all the obvious mistakes and permutations of your valuable domains. |
 With Apache servers use mod_rewrite
|
| When you attach multiple domain names to a site, search engines can become confused and your rankings may suffer. If they find the same page at two or more different URLs, the search engines will sometimes filter out the extra listings, but there's no guarantee of which ones they filter. You also don't want people linking to your site with non-standard domain names because that will tend to divide your inbound link strength. Google themselves say, |

|
"If your site is appearing as two different listings in our search results, we suggest consolidating these listings so we can more accurately determine your site's PageRank." 1
Why leave it to chance? With a few lines of code you can make sure all your URLs use consistent domain names. When we have multiple domain names on one site, we set up a permanent 301 redirect for any extra domains, as well as the www subdomain or the non-www domain. If you have an Apache web server, add the following code to a .htaccess file in the top level directory, replacing the test domain name with yours:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.test\.com
RewriteRule ^(.*) http://www.test.com/$1 [L,R=301]
If you are using a Microsoft IIS web server, we recommend using ISAPI_rewrite to simulate Apache's .htaccess feature. To begin, you or your hosting provider needs to install ISAPI_rewrite on the server. Then you would create a httpd.ini file in the top level directory as follows, replacing the test domain name with yours.
RewriteCond Host: (?!^www\.test\.com$).*
RewriteRule (.+) http\://www.test.com$1 [RP,I]
These solutions assume you prefer to use the www subdomain for your website. If you would rather have a non-www URL, simply remove each instance of "www\." and "www." from the rewrite conditions and rules. As with all code, please test thoroughly before deploying to your live server.
If your host does not offer ISAPI rewrite you could create a second IIS entry and redirect all the similar names to the primary (i.e.) www.domain.com. This method does take two IIS entries but will certainly achieve the same thing without the need for ISAPI rewrite if your host does not offer it.