Integrate own error pages

Sometimes users encounter an error on your website. This can have several causes. Perhaps Google has quite simply shown a page in the search results which is now no longer on your website. Or you inadvertently went live with a faulty transformation.

In these cases, the user is then shown an ASP.NET error message. In the preview environment, the Render Engine should be set in such a way that you are shown the exact error message, and so that you as a web developer can troubleshoot the error. This should not be the case on the live page however. A general error message at least would be appropriate here. It is better however if the user is forwarded to a content page of your website which tells him in a pleasant way that an error has occurred. You can then design this page yourself and also put in an individual text.

You should create your own error pages in your editor first. In doing so, make sure that the pages do not appear in any navigation.

There is a special section in the “web.config” file of your Render Engine for the configuration of these error pages in the case of particular errors. In the section <system.web> you can configure the <customErrors/>. Since this is an ASP.NET functionality, there is also documentation from Microsoft. The section could look as follows for example.

<customErrors defaultRedirect="GenericError.htm" mode="RemoteOnly">
  <error statusCode="404" redirect="NotFound.htm"/>
  <error statusCode="500" redirect="InternalError500.htm"/>
  <error statusCode="503" redirect="InternalError503.htm"/>
</customErrors>

By means of the <error> elements, you can configure an individual error page for each HTML error code. If no own error page is found for an error code that arises, the user is automatically forwarded to the address specified in the attribute “defaultRedirect”.

The error pages can be provided via quicklinks. You should set the appropriate HTTP status code there, instructing search engines to remove this page for example.