If i have a folder named xxx and a route like this:
routes.MapRoute(
"TestRoute",
"xxx/{action}",
new { controller ="xxx", action="Index" }
);
By default, when i request /xxx, IIS will try to return a directory listing, but I want my route to have precedence over folders/files on requests.
How do i do this?
Here's a post that describes your issue and has a solution: http://forums.asp.net/t/1251156.aspx/1
Here's the meat of the answer on the link I provided:
By default, DirectoryListingModule take precedence over UrlMappingsModule. Fortunately, it is possible to change the order of UrlMappingsModule and DirectoryListingModule.
Goes to IIS7 Manager -> Modules, in the right pane, click View Ordered List, you can then use Move Down, Move Up to change the order of modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With