Current Route
// Create the front-end route.
Route defaultRoute = routes.MapRoute(
"CMS_Default",
"CMS/RenderMvc/{action}/{id}",
new { controller = "RenderMvc", action = "Index", id = UrlParameter.Optional }
);
defaultRoute.RouteHandler = new RenderRouteHandler(cmsContext, ControllerBuilder.Current.GetControllerFactory());
Desired Functionality
I would like any URL to be picked up e.g. /home
, /about-us
, /contact-us
and go to the current route above: /cms/rendermvc/home
, /cms/rendermvc/about-us
, /cms/rendermvc/contact-us
as this is were it will take the URL segment or in the routes case the {action}
and do the logic for getting the content from the database. I would like to do this without the use of a default {*url}
route.
Current Ideas
I'm not very familiar with it but couldActionFilters
be used in this instance?- I believe this could be achieved by a default module?
Desired Functionality Examples
Umbraco has the identical routing structure I am after, just with a lot more complexity.