Skip to content

Instantly share code, notes, and snippets.

@jpolvora
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpolvora/0a6f815fccfcdc57225e to your computer and use it in GitHub Desktop.
Save jpolvora/0a6f815fccfcdc57225e to your computer and use it in GitHub Desktop.
routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(css|js|txt|png|gif|jpg|jpeg|bmp)(/.*)?" });
routes.IgnoreRoute("{*staticfile}", new { staticfile = ".*\\.(?i)(css|js|xml|txt|png|gif|jpg|jpeg|bmp|ico|woff|svg|ttf|eot)(\\/.*)?" });
var error = Server.GetLastError(); //filterContext.Exception
var exception = error as HttpException ?? new HttpException("Error", error);
if (exception.GetHttpCode() == 404)
return;
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(?i)(css|js|xml|txt|png|gif|jpg|jpeg|bmp|ico|woff|svg|ttf|eot)(/.*)?" });
routes.IgnoreRoute("Content/{*pathInfo}");
routes.IgnoreRoute("Scripts/{*pathInfo}");
routes.IgnoreRoute("Bundles/{*pathInfo}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment