Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sitecore - Handle 500 errors separately per site in multisite setup

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.

like image 685
Jesan Fafon Avatar asked Dec 07 '22 07:12

Jesan Fafon


2 Answers

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

like image 190
Varun Shringarpure Avatar answered Apr 26 '23 23:04

Varun Shringarpure


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

like image 39
Mark Ursino Avatar answered Apr 26 '23 22:04

Mark Ursino