Skip to content

Instantly share code, notes, and snippets.

@tackme31
Created October 18, 2019 16:01
Show Gist options
  • Save tackme31/2cf266878f28766716c5c2c1dfdb9e55 to your computer and use it in GitHub Desktop.
Save tackme31/2cf266878f28766716c5c2c1dfdb9e55 to your computer and use it in GitHub Desktop.
A configuration for setting a custom error page to Sitecore when a 404, 50x error occurs.
<!-- Add the following section to your web.config -->
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" subStatusCode="-1" />
<remove statusCode="500" subStatusCode="-1" />
<remove statusCode="501" subStatusCode="-1" />
<remove statusCode="502" subStatusCode="-1" />
<!-- Response the not found page (without changing a URL) -->
<error statusCode="404" prefixLanguageFilePath="" path="/notfound" responseMode="ExecuteURL"/>
<!-- Redirect to the static error page -->
<error statusCode="500" prefixLanguageFilePath="" path="/error.html" responseMode="Redirect"/>
<error statusCode="501" prefixLanguageFilePath="" path="/error.html" responseMode="Redirect"/>
<error statusCode="502" prefixLanguageFilePath="" path="/error.html" responseMode="Redirect"/>
</httpErrors>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment