I'm building a web application (ASP.NET MVC 5) with a custom admin section where all the parameters of the apps are.
I want to be able to easily change the name of this section.
E.g.
myapp.com/admin/{controller}/{action}
could be
myapp.com/custom-admin-name/{controller}/{action}
I've tried to use areas but it seems like it would be hard to edit their name since all the controllers and models are bound to the area's namespace.
I've also tried to set custom routes
routes.MapRoute(
"AdminControllerAction",
"custom-admin-name/{controller}/{action}",
new { controller = "Dashboard", action = "Index" }
);
So I could do
mywebsite.com/custom-admin-name/dashboard/index
But the problem with that is that my admin controllers and actions are still callable using
mywebsite.com/dashboard/index
Is it possible to cancel the default routing of a controller/action ?
Is there any more viable solutions to this problem that I wouldn't have thought about ?