Is it possible to make an ASP.NET MVC route based on a subdomain?
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: public class ExampleRoute : RouteBase { public override RouteData GetRouteData(HttpContextBase httpContext) { var url = httpContext.Request.Headers[“HOST”]; var index = url.IndexOf(“.”); if (index < 0) … Read more