I'm creating a cut down version of a CMS using MVC 5 and I'm trying to get through the routing side of things.
I need to handle pages with urls such as /how-it-works/
and /about-us/
etc and therefore content is keyed on these paths.
In my RouteConfig
file I'm using a 'catch all' route as follows::
routes.MapRoute("Static page", "{*path}", new { controller = "Content", action = "StaticPage" });
This successfully hits the controller action I'm looking, however it therefore means that requests for controller actions that actually do exist (for example /navigation/main
also get sent down this route).
I know that I can have a route that matches /navigation/main
however I'd rather configure MVC to do this as default, like it does when I don't add the rule I have above, any ideas?