In MVC 5 application, I want to accept two different kinds of request URL:
http://www.myapp.com/brand/controller/action
http://www.myapp.com/controller/action
Both URL should be directed to controller action.
I tried to include optional parameter brand in it, but no luck.
RouteTable.Routes.MapRoute(
"default",
"{brand}/{controller}/{action}",
new { brand = UrlParameter.Optional, controller = "Home", action = "Index" });
Apparently optional parameter is not allowed before controller.
Any idea?