MVC controller gives me a 403 forbidden error with the default route when it’s called DocumentationController

Make sure you don’t have an actual virtual/physical directory named Documentation.

You can also instruct MVC to ‘take over’ the request even when it matches a directory by setting the RouteExistingFiles flag to true (in your Routes configuration):

public static void RegisterRoutes(RouteCollection routes)
{
    routes.RouteExistingFiles = true;

    //...
}

Leave a Comment