Running more domains (sites) on 1 hosting account.

Date:Aug 10, 2010 Ages: Price: Type: Location:

The problem: sometimes you want more sites with their own domainname to run on your hosting account. For example, when i have a few testing- or low-traffic sites it’s much more economic (e.g. cheaper) to use just 1 hosting account for that.

The other day i found this solutionfor a hosting plan with Windows 2008/IIS7 and Adobe Coldfusion 9 running.
On Apache hosting plans you would just configure a few virtual hosts and/or use mod_rewrite and on a Microsoft platform it involves either installing IIS 7 Manager and the URL Rewrite module on your local PC or editing the web.config file directly.
When connected with IIS 7 Manager to your (Windows) hosting provider, startup the URL Rewrite module. This is the GUI to web.config file which should be placed in the root of your hosting account and is also editable.

My web.config looks like this, adjust the example texts.


< ?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system .webServer>
<rewrite>
<rules>
 <rule name="Example 1" stopProcessing="true">
     <match url=".*" />
      <conditions>
         <add input="{HTTP_HOST}" pattern="^(www.)?example-site.info$" />
         <add input="{PATH_INFO}" pattern="^/example-site/" negate="true" />
      </conditions>
<action type="Rewrite" url="\example-directory\{R:0}" />
</rule>
</rules>
</rewrite>
    </system>
</configuration>

This should route all incoming HTTP requests for both www.example-site.info and example-site.info to the folder (directory) at the webhost through a ’301 Moved Permanently’. So far it works with 4 domains, all with fairly low traffic so no problems with the fair use policy in a shared environment.

Here’s the ‘Getting Started’ with IIS URL Rewrite (Windows 2008/IIS7) and some usefull tips and tricks.

Leave a Reply

Leave a Reply