Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@robdmoore
Created August 31, 2014 07:03
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 robdmoore/efd01bd380c3c90ef3c3 to your computer and use it in GitHub Desktop.
Save robdmoore/efd01bd380c3c90ef3c3 to your computer and use it in GitHub Desktop.
XDT Transformation to add custom error page URLs to an ASP.NET application.
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Replace" xdt:Transform="Insert">
<remove statusCode="404" />
<error statusCode="404" path="/error/404" responseMode="ExecuteURL" />
<remove statusCode="500" />
<error statusCode="500" path="/error/500" responseMode="ExecuteURL" />
<remove statusCode="403" />
<error statusCode="403" path="/error/403" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment