How to set up a subdomain of a web site with IIS

  
                  

How do I create a subdomain with IIS 5.0 on a W2K server? If I let 45it.com be at the root web site and want to let ask.45it.com take me to a new folder or subsite, how do I set it up? All the information I can find is about how to configure 45it.com/ask as a URL.


A: Your web site architecture and its integration with DNS is certainly a critical part of your IIS installation. As you said, configuring a site for 45it.com/ask is easy because it's actually a folder or virtual directory located on the 45it.com site. Configuring ask.45it.com as a "subsite" is another matter, as you already know. By design, the composition of the URL is this: http://domainname.com should be the parent domain of http://hostname.domainname.com. This is due to the design of DNS, which is required by DNS to use this namespace structure. However, as far as a web server is concerned, they are two completely different concepts. IIS doesn't think there is anything in it.

Therefore, you should treat ask.45it.com as a completely different web site. In DNS, you can add an A record to ask.45it.com that assigns ask.45it.com the same IP address as 45it.com. Then, create an ASP page that uses it to check the incoming URL and route the request accordingly. This is useful if you want the "subdomain" to be routed to a folder within your main web site. Alternatively, you can create a brand new web site with a new IP address (which must be configured in DNS) or with a host header within IIS to identify it.


You can create a new web site for your "subdomain" with its home folder as a location within its parent domain. Although this is possible, I recommend that you do not do this, because you will find that the same content will have two management interfaces, and there is no way to keep them in sync. This can cause difficulties in troubleshooting configuration and security issues.

Copyright © Windows knowledge All Rights Reserved