Supporting sub-domains in IIS

Posted by Sitt Sen Chok | Filed under , ,

One of the common requirements for a site is to support sub-domains, such as one that represents a specific product site under the same company banner.  For example, http://msdn.microsoft.com  is a sub-domain of http://microsoft.com.  Quite often a sub-domain physically points to a separate website hosted either under the same web server instance or under a different instance altogether.

For support of sub-domain to occur, there are a number of things that need to be configured at the domain name hosting provider level and at IIS web server level.  The following are the necessary steps to setup sub-domain support.  For illrustration purposes, we assume the task of setting up a sub-domain product-name and the main domain company.com.

Hosting provider

  • Add a “A" record for the sub-domain product-name which points to a static IP address.  The IP address should be one served by the target IIS instance.  There should be a separate “A" record for the main domain name company.com, and a similar one for the sub-domain of www to cater for the URL of http://www.company.com.

IIS

  • Under IIS Manager, create a website for product-name.company.com.
  • Configure the identites for the website by:
    • Bring up the Properties sheet for the new website.
    • Select the “Web Site” tab.
    • Click on the “Advanced..” button.
    • Under the “Multiple identities for this Web site” section, change the default entry to have host header value of product-name.company.com.
  • Repeat the above steps in IIS for the main website company.com which should have two identities represented by host header values of www.company.com and company.com.

By performing the above steps, the IIS web server instance should know which website that an incoming web request should be served from. Note that only IIS version 6.0 and above supports multiple websites as described in the other post.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading