c# - How do I block access to files when using the System.Web.Routing.UrlRoutingModule? -
I system. I am using the web. Routing URLRotting module
I am writing with:
route Add (new route (@ "cart / add", new route handler ("~ / command / karted shakes"))); way. Add (new route (@ "cart / remove", new route handler ("~ / order / cartiite.shakes"))); ...
And I also have a route:
route. Add (new route (@ "{* url}", new route handler ("~ / error / PageNotFound.ashx")));
But if I direct on / Order / CartAdd.ashx I never enter routing. It goes straight to that handler
In your root registration code, you can type something like this.
Public static zero registrations (routes collection route) {routes.RouteExistingFiles = true; Routes.IgnoreRoute ("default.aspx"); [...]
You should emphasize files through your routing rules.
Comments
Post a Comment