Click here to Skip to main content
15,672,024 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

If a website in IIS is to contain sub domains or sub-applications can someone clarify please,

Is there a difference between a sub-domain and sub-application? Is a sub-domain just a folder within the website root and URL path to that folder and a sub-application and complete website within a website?

Sometimes there are URL's with the sub-domain or sub-application as a prefix BEFORE the root website name, i.e., where as there are sub-domains or sub-applications with their name as a suffix, or AFTER the root website URL, i.e. What determines this please?

What I have tried:

Looking through Microsoft IIS documentation site

general google but didn't find anything that explained the reasons for differences
Updated 27-May-21 23:26pm

1 solution

When the name appears before the root website name, there is a DNS record (usually either an A record or a CNAME record) for that name which points to the server's IP address. That DNS record can be mapped to a website in IIS using the "host headers" binding; or all records which resolve to a specified IP address can be mapped to the same website by leaving the host headers blank.

When the name appears after the root website name, it is a path within the domain; it is not a subdomain. The path could be a virtual or physical directory within the root website, which may or may not be configured as an IIS "application". Or the root website could use URL routing to map the request to a handler within the root website.
Share this answer
jar8695 2-Jun-21 4:59am    
Thanks for response Richard. So, a name prefixed to root IS A SUBDOMAIN and really a website on its own which requires its own DNS mapping and CANNOT be mapped within the root DNS - is that correct? Concerning a suffixed name - this can be a "path" to a subdirectory which is simply a component WITHIN THE ROOT, is that correct? Then what is an "application "within" a website root?
Richard Deeming 2-Jun-21 5:26am    
The name prefix to the root domain is a subdomain which requires a DNS entry. However, it can be mapped to the same site as the root domain. IIS is quite flexible about mapping incoming requests to sites.

If you needed to know which domain was requested, you could examine the "server variables" collection and extract the HTTP_HOST header.

The suffixed name is simply a physical or virtual directory within the root site. If it's marked as an application, then it runs in a separate AppDomain from the root site, and will have its own bin folder, global.asax, etc. Otherwise, it's part of the root application for the site.

iis 7 - Difference between application and virtual directory - Server Fault[^]
Understanding Sites, Applications, and Virtual Directories on IIS 7 | Microsoft Docs[^]
jar8695 2-Jun-21 5:38am    
Thanks again Richard. Great feedback

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900