Skip to content

Instantly share code, notes, and snippets.

@VaclavElias
Created September 17, 2018 14:09
Show Gist options
  • Save VaclavElias/83bba1fb34284efe1eb11942bee4829b to your computer and use it in GitHub Desktop.
Save VaclavElias/83bba1fb34284efe1eb11942bee4829b to your computer and use it in GitHub Desktop.
Negative Constrain in MapRoute
 routes.MapRoute(
                    name: "catch-all",
                    template: "{*url:regex(^(?!(.*.map)).*$)}",
                    defaults: new { Controller = "Page", Action = "Index" }
                    //constraints: new { url = @".*\.js.map" }
                    );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment