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

NibblyPig

Is DocumentationController reserved for system usage or something?

I created a blank MVC app, created a DocumentationController with corresponding view. It works if I go to www.mysite.com/Documentation/Index but if I go to www.mysite.com/Documentation/ then I get a 403 forbidden.

Renaming DocumentationController to Documentation2Controller and associated views, it (the default route, etc.) works perfectly.

Is it a reserved keyword or could there be another reason why it doesn't pick up the default route?

haim770

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;

    //...
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

403 forbidden in MVC application when trying to browse directory without controller

From Dev

{{csrf_token}} gives me 403 Forbidden and {%csrf_token%} gives me 500 Server Error

From Dev

403 Forbidden error when geocoding

From Dev

Pandas pd.read_html() Function Gives me 'HTTP Error 403: Forbidden'

From Dev

Apache gives 403 Forbidden

From Dev

Apache gives 403 Forbidden

From Dev

MVC4 403 forbidden error with siteminder

From Dev

Why is using cURL giving me a 403 forbidden error when file_get_contents works?

From Dev

403 forbidden error when posting in expressjs

From Dev

WAMP 403 forbidden error when using 'glob()'

From Dev

403 Forbidden error when accessing site (Joomla)

From Dev

HTTP Error 403: Forbidden when reading HTML

From Dev

403 Forbidden error when accessing site (Joomla)

From Dev

Drupal, getting list of nodes gives 403 Forbidden Error

From Dev

Drupal, getting list of nodes gives 403 Forbidden Error

From Dev

Google Static map without api key gives 403(forbidden) error

From Dev

Single route giving a 403 Forbidden error in Laravel 4

From Dev

AWS CLI S3 A client error (403) occurred when calling the HeadObject operation: Forbidden

From Dev

When i update gradle SDK's, popup the error is Recieved status code 403 from server-Forbidden

From Dev

DELETE 403 (Forbidden) error spring-mvc and rest implementation

From Dev

getting 403 forbidden error

From Dev

nginx 403 Forbidden error

From Dev

Heroku 403 Forbidden Error

From Dev

403 Forbidden error on Genymotion

From Dev

403 forbidden error at Nginx

From Dev

403 Forbidden Error LEMP

From Dev

Grunt 403 forbidden error

From Dev

403 Forbidden Error

From Dev

Apache 403 Forbidden Error

Related Related

HotTag

Archive