4
votes

We're running Sitecore in a multi-site configuration and currently have custom 404 pages for each of our sites.

What we would also like is to have custom 500 pages for each site. I haven't found much on how that works (if it does) in Sitecore, and was hoping the community had some insight into how to set up custom 500 pages in a multi-site Sitecore setup. Currently, we have one 500 page the two sites share. This is fine in development, but in production we don't want to expose the fact that these sites share the same box.

4

4 Answers

5
votes

A 500 error is a server error so Sitecore can't process it. It should be a generic flat HTML file configured is IIS or the web.config

7
votes

Well as per my knowledge, what you can do is you can directly set a URL to be executed (.i.e. it goes to your common Custom Error Page), where you decide the site-specific error details to be shown.

Considering that you are using IIS 7.0 or 7.5, please follow the steps as below:

  1. Open IIS Manager
  2. Go to your Site, in the Sites Section.
  3. Click on Error Pages in the IIS Section. Error Pages in Site

  4. Next, you will move to the Error pages set by IIS. Go to Error code 500, select it and click on Edit in Actions Pane. Error Page for 500

  5. Now select the option of Execute a URL and select a common page, say /sitecore/MyErrorPage/500ErrorPage.aspx and then, handle site-specific error messages in that particular page.

Set Custom Errorpage

Hope this Helps!

Regards,

Varun Shringarpure

2
votes

You can override the processor "Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel" to handle Sitecore error like item not found, layout not found etc. See more details here: http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2013/04/Handling-Errors-in-the-Sitecore-ASPNET-CMS.aspx

But when handling 500 errors you should do it outside of Sitecore, think about what happens if you serve your 500 error page in Sitecore but Sitecore is down due to for example sql connection issues or timeouts? Your users will end I a redirect loop.

1
votes

Take a look at the Error Module on the marketplace. I think it will give you want you want.