Asp.Net Routing: How do I ignore multiple wildcard routes?

There are two possible solutions here.

  1. Add a constraint to the ignore route to make sure that only requests that should be ignored would match that route. Kinda kludgy, but it should work.

    RouteTable.Routes.IgnoreRoute("{folder}/{*pathInfo}", new {folder="content"});
    
  2. What is in your content directory? By default, Routing does not route files that exist on disk (actually checks the VirtualPathProvider). So if you are putting static content in the Content directory, you might not need the ignore route.

Leave a Comment