Try our conversational search powered by Generative AI!

404 Error page setup

Vote:
 

How to setup 404-error page in episerver cms

#253291
Apr 15, 2021 13:24
Vote:
 

Hi,

You can use this module

https://github.com/Geta/404handler

#253292
Apr 15, 2021 13:43
Vote:
 

There's no need to install the Geta handler if you just want 404 pages and not CMS controlled redirects.

Turn custom errors off

  <customErrors mode="Off" />

Configure HTTP Errors pointing at a CMS path

<system.webServer> 
  <httpErrors errorMode="Custom" existingResponse="Replace">
      <remove statusCode="404" />
      <error statusCode="404" responseMode="ExecuteURL" path="/NotFound" />
  </httpErrors>
</system.webServer> 

Setup a controller for the error page that returns a 404 response in the controller action

Response.StatusCode = 404;
#253297
Edited, Apr 15, 2021 16:33
Scott Reed - Apr 15, 2021 16:35
You can of course use a static page but I prefer to put 404 pages in the CMS and static pages for 500 errors
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.