Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route? For example:
- user1.domain.com goes to one place
- user2.domain.com goes to another?
Or, can I make it so both of these go to the same controller/action with a username
parameter?
Best Answer
You can do it by creating a new route and adding it to the routes collection in RegisterRoutes in your global.asax. Below is a very simple example of a custom Route: