ASP.NET MVC Route with values before the controller and no trailing slash
问题 This is probably a simple question but I just can't get it to work. I've got this route specified in my RouteConfig routes.MapRoute( name: "DefaultSiteRoute", url: "{accountid}/{hostname}/{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, accountid = UrlParameter.Optional, hostname = UrlParameter.Optional } ); And it works fine for a url like this /123456/www.test.com/ or this /123456/www.test.com/Controller/Action but it can't cope