I want to deploy multiple asp.net mvc applications under a single domain, but I am not sure what is the proper way to do it in IIS.
I want them to have the following urls
www.domain.com/something-from-app1
www.domain.com/something-from-app2
There are couple of options that I had in mind, but not sure would they actually work in practice.
Deploy each app as a subdomain and then do a rewrite
app1.domain.com/something to www.domain.com/something-from-app1
app2.domain.com/something to www.domain.com/something-from-app2
Deploy each app under a virtual folder of a domain and then do a rewrite
www.domain.com/site/app1/something to www.domain.com/something-from-app1
www.domain.com/site/app2/something to www.domain.com/something-from-app2
Both options are just pure theory, and I would like to know will both scenarios work as I explained abovre?
All these options are possible. However, there's no reason for any rewriting, because you can also directly host the apps in the desired locations,
If you want to hide these, consider that the URLs should be different. Otherwise there's no way to distinguish which app should handle the request. Subdomains would be fine.
Either method will work. If you want to go with the 2nd option while obfuscating the path, you can create a Virtual Directory in IIS. This can make it appear at the root, but is actually pointing elsewhere (like a shortcut/link).
Additional reading: https://msdn.microsoft.com/en-us/library/bb763173.aspx
Edit: An option similar to Virtual Directories (but more app oriented), is to create (or convert those virtual directories into) Applications. That way you can assign them to their own Application Pools, segregate sessions from the root app (and each other), etc.