We have an MVC application that is accessed from two separate websites. The default website is fine, however how can I setup the second site to startup in a specific Controller?
Our default site is www.mysite.com, and we’d like to add a second IIS site for the header www.subdomain.mysite.com that should take users to www.subdomain.mysite.com/controller
But how can I tell IIS to startup www.mysubdomain.mysite.com with the specific controller action mycontroller?
I ended up adding a value to my
AppSettingsin web.config, and adjusting the default route of the application based on that value.This allows me to host any number of IIS sites that can each start with a different controller in the application.