I'm new to IIS administration, but I need to set up a site that whose site root has multiple directories that are also sites.

For example, say I have site at http://www.example.com

The root directory of that sites has multiple folder for it's content, but also has two other directories, say, /community and /labs.

I want to make these directories be the doc root for separate sites such that you'd access a completely different asp.net site if you went to http://www.example.com/community or http://www.example.com/labs from that if you went to the main site at http://www.example.com.

Really, this would be 3 sites in one directory.

I can see how you could create separate sites using different ports, but I want them all to be on port 80.

Are these subdirectory sites Virtual Sites? I know this is possible to do because our sys admins have set this up for our corporate site, to which I've published many times, but I'm trying to do this myself and I can't get an answer from corporate IT on how they did it. :^)

Thanks, Scott

3 Answers 3


This is pretty easy in IIS 7.5

Since a "Web Site", simply put, is just a placeholder with at least 1 endpoint mapping (a Binding), and 1 or more applications.

Create a website (or modify the settings of the Default Web Site). When you expand the web site in the IIS Manager, you'll see a tree of subdirectories, namely the subdirectories in the physical directory that your website root application points to.

Right-click the subdirectory you want to host another application in (eg. "Community") and select Convert to Application. Now you'll be able to configure an alternative Application Pool to serve the content, and you can configure the application individually, independent of (almost) any the feature settings on your root application.

For a more in-depth explanation, visit Mike Volodarsky's blog, he designed the IIS 7 application architecture, so if anyone, he knows what's what :-)

  • This isn't working for me. If I create a website at inetpub/wwwroot/ Website1, with 2 subdirectories Application1 and Application2, both applications just a simple static index.html file. I select convert each Application1 and Application2 to application. Navigate to localhost/Application1 and it gives the error that WebSite1/index.html cannot be found. Any idea what might be wrong?
    – Neutrino
    May 30, 2017 at 16:21
  • 403 error for mvolo.com/blogs/serverside/archive/2007/07/12/…
    – Kiquenet
    Dec 21, 2017 at 11:09

In IIS7, each site has a default Application, but you can add sub-Applications quite easily. Just right-click on the site, then click "Add Application." Here you would specify the alias (/community), the application pool (might want to make a new one beforehand), and the path to the physical files on the server.

  • any good patterns and practices about IIS: WebSite, Applications, Virtual Directories, AppPool? aspnet 4.7.1 and IIS (Windows Server 2012 R2) Now, we have in a client 51 apps in Default Web site with the same DefaultAppPool
    – Kiquenet
    Dec 21, 2017 at 11:07

An alternative way that doesn't touch existing sites (as many are created and managed by M$ products automagically) is a reverse proxy with URL rewrite and/or response patching if necessary:

Reverse Proxy with URL Rewrite v2 and Application Request Routing

The rather lengthy instructions there boil down to:

  • install the IIS rewrite extension
  • add the likes of these lines to the root web.config under /configuration/system.webServer (it's shown how to add them with the InetMgr's UI):
    <!--route requests-->
        <rule name="Reverse Proxy to webmail" stopProcessing="true">
            <match url="^webmail/(.*)" />
            <action type="Rewrite" url="http://localhost:8081/{R:1}" />
        <rule name="Reverse Proxy to payroll" stopProcessing="true">
            <match url="^payroll/(.*)" />
            <action type="Rewrite" url="http://localhost:8082/{R:1}" />
    <!--patch response HTML-->
        <rule name="Add application prefix" preCondition="IsHTML">
            <match filterByTags="A" pattern="^/(.*)" />
                <add input="{URL}" pattern="^/(webmail|payroll)/.*" />
            <action type="Rewrite" value="/{C:1}/{R:1}" />
            <preCondition name="IsHTML">
            <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.