How to map a subdomain to a folder in Websitepanel

You can make unlimited subdomains and map them to a folder within your website's main root folder. The following steps will assist you to set this up.
For our example we will make a subdomain named "billing.yourdomain.com" that is using the folder "yourdomain.com/wwwroot/billing".

 ** Before you make change's to your web.config file we strongly suggest you make a backup of the web.config file in case you encounter any errors**

1. Add a DNS "A" record for "billing" point it to the same ip as your www A record points to.

2. Add a website pointer for "billing.yourdomain.com" pointing to "yourdomain.com" in the control panel on the website properties page

3. Add a folder named "billing" inside the wwwroot folder for yourdomain.com (yourdomain.com/wwwroot/billing)

4. Add a test page named index.html inside billing folder (yourdomain.com/wwwroot/billing/index.html)

5. Open your web.config file in the <system.webServer> section add the following rewrite rule (yourdomain.com/wwwroot/web.config)

<rewrite>

   <rules>

       <rule name="billing" enabled="true">
           <match url="(.*)" />
           <conditions logicalGrouping="MatchAny">
           <add input="{HTTP_HOST}" pattern="^billing.yourdomain\.com$" />
           </conditions>
           <action type="Rewrite" url="/billing/{R:0}" />
       </rule>

   </rules>

</rewrite>

           

6. Browse to billing.yourdomain.com, you should see your index.html test page (yourdomain.com/wwwroot/billing/index.html)
  • 122 Users Found This Useful
Was this answer helpful?