Sitecore Multi-Site custom 500 error page

This post is an add on to my previous post Secure Sitecore : Why use a custom 500 error page? In this post I will go through how you can get a multi-site custom 500 error page in a Sitecore solution.

This would mean that each site in your Sitecore instance can have it’s individualized custom 500 error page. As I mentioned before, I truly believe it makes absolute sense to have a static 500 error page rather than on inside of Sitecore for obvious reasons.

A version of this code exists in production environments and has been working like a charm.

First, we need to add Global.asax because we need to process Application_Error event. Second, try not to use any Sitecore API in this file.

We added an AppSettings config flag to control the processing. In your web.config add the following to the AppSettings section:

You would also need to make a few changes in the Web.config. First add in the httpErrors node in :

Also set the customErrors mode as On.

Next we need to add the Application_Error event in the global.asax.cs file. Here is a sample below:

Hope this helps you out with your solution.

If you have any questions or concerns, please get in touch with me. (@akshaysura13 on twitter or on Slack).

no comment

Add your comment

Your email address will not be published.