I am having troubles understanding the default route setup in MVC5. I have this code in the RouteConfig.cs file
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Content",
url: "content/{action}",
defaults: new { controller = "Content", action = "Index" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
When I go to www.mydomain.com/content/index it works fine. However if I go to www.mydomain/content I get an error 403.14 Forbidden. I understand this is a newbie question but what am I missing? Should it not default to the index controller?
RouteExistingFilestotruewill work, I don't think it's the way to go.