Point subdomain to (sub-) directory on IIS 7

iis-7

I have quite a newbie question, but here it is anyway: one of our customers has a domain, e. g. examplecustomer.com which points to the customers website. This server is a apache webserver.

Now we have another server using IIS 7, where some .NET web app will be running. This .NET app is in a subdirectory of the windows webserver, e. g. C:\inetpub\wwwroot\my_app\

What I would like to have: a subdomain like app.examplecustomer.com points to C:\inetpub\wwwroot\my_app\ (no redirect or so, app.examplecustomer.com is the domain that the web app is using).

How can I setup the windows webserver to work that way? It should still be possible to host other apps on that server, too. Like: anotherapp.examplecustomer.com goes to C:\inetpub\wwwroot\my_anotherapp\ etc.

Best Answer

All you need to do is create another site in IIS for that subdomain, and point its root to the applications directory.

So create the site, set it's host headers to be that of the subdomain, set its root to the location of the app, setup .net the way you want it, ensure the subdomain is created in DNS and pointing to that server and your done.