Try our conversational search powered by Generative AI!

Implementing a 500 status code page


Is a 500 staus code page out of the box in optimizely, or is it possible to implement a page in case of a 500 error? We have already implemented a 404 page, maybe we can reuse something?

Edited, Aug 30, 2023 12:18

I don't think there is a built in page. also it does not "handle" 500 redirect, that's ASP.NET Core job. You probably can use UseStatusCodePagesWithRedirects and then reuse your 404 page to display 500 error if that happens?

Aug 30, 2023 12:33
Tam Duc Ha Vo - Aug 30, 2023 12:36
Aha, i'll take a look at the UseStatusCodePagesWithRedirects. Thank you!

I would recommend using UseStatusCodePagesWithReExecute instead of UseStatusCodePagesWithRedirects, then the error code and URL is kept. As of EPiServer.CMS.UI 12.20.0 we do provide error pages for 403, 404 and 500 when not in development mode/environment. So if you set environment name to production, you can actually test this.

Edited, Aug 30, 2023 13:17
Quan Mai - Aug 30, 2023 13:58
that's ... new to me :) interesting that we now include the error pages
Tam Duc Ha Vo - Aug 31, 2023 11:05
Ah okey. If it's out-of-the-box we won't have to implement a 500 error page. Thank you!
Vincent - Sep 01, 2023 0:29
Wow, that's new to me too. Do you have more details about this built-in error pages? is it possible to customize that? what about if the solution has already used in the solution to handle errors, which one will be used? built-in one or custom one?
Johan Petersson - Sep 01, 2023 6:54
These error pages acts as fallbacks. So no, you can't customize them, they have static content. You customize by just adding your own error handling, e.g. via UseStatusCodePagesWithRedirects.
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.