I realize there are a few articles on similar things but none of which has helped me.
I have a single web app with multiple domains pointing to the same app. I would like to know how I can map a route to a specific controller based on the domain that is trying to access the web app.
What I currently tried is the following with no success.
routes.MapRoute(
name: "WowPoetry",
url: "wowpoetry.org/{action}/{id}",
defaults: new { controller = "Wow", action = "Index", id = UrlParameter.Optional }
);
I ended up following this tutorial to achieve what I wanted to with the exception of I used to to do domain routing and not subdomain routing.
Domain Routing Tutorial ASP.Net MVC
Implementation:
DomainData.cs
DomainRoute.cs