Sitecore - handle 500 errors separately for each site in a multi-level setup

We run Sitecore in a multi-site configuration and currently have 404 user pages for each of our sites.

We would like to have a custom 500 page for each site. I did not find much about how this works (if so) in Sitecore, and was hoping the community would learn how to set up custom 500 pages in setting up Sitecore on multiple sites. Currently, we have one 500 pages that host two sites. This is good in development, but in production we do not want to disclose the fact that these sites have the same area.

+4
source share
4 answers

Error 500 is a server error, so Sitecore cannot handle it. This must be a generic flat HTML file configured as IIS or web.config

+5
source

Well, to my knowledge, what you can do is that you can directly set the URL that will be executed (for example, it goes to your general user error page), where you determine the details of the error for a particular site.

Given that you are using IIS 7.0 or 7.5, follow these steps:

  • Open IIS Manager
  • Go to your site in the "Sites" section.
  • Click "Error Pages" in the IIS section. Error Pages in Site

  • Next, you will be taken to the error pages defined by IIS. Go to Error Code 500, select it, and click Edit in the Actions panel. Error Page for 500

  • Now select the Run URL option and select the shared page, say / sitecore / MyErrorPage / 500ErrorPage.aspx, and then process the site error messages on that particular page.

Set Custom Errorpage

Hope this helps!

Hello,

Varun Shringarpur

+7
source

You can override the processor "Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel" to handle a Sitecore error, for example, an element was not found, the layout was not found, etc. See here for more details: 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 have to do this outside of Sitecore, think about what happens if you serve 500 error pages in Sitecore, but Sitecore doesn’t work due to, for example, sql connection problems or timeouts? Your users will complete the redirect cycle.

+2
source

Take a look at the error module in the market . I think this will give you the desire you want.

+1
source

Source: https://habr.com/ru/post/1479003/


All Articles