MVC 4 routing - ignore requests for images
问题 I'm trying to prevent users from making requests to access images on their own in my web application, so the user shouldn't be allowed to make this type of request: sitename/Images/test.jpg I've tried specifying a route to ignore in RouteConfig.cs but it still serves images on their own, is there a way to prevent this? This is what I've tried: routes.IgnoreRoute("{file}.jpg"); routes.IgnoreRoute("Images/{file}.jpg"); routes.IgnoreRoute("{resource}.jpg"); routes.IgnoreRoute("Images/{resource}