On my project I have only one controller so I want to do this:
http://www.example.com/{action}/{optional id}
All actions will be of a defined controller.
Change the path templates in the Global.asax
there will be something like
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // route
new { controller = "Home", action = "Index", id = UrlParameter.Optional }); // defaults
}
to change to something like
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional });
}