Configure a custom error page

Issue

Is there a way to create a custom error page for 404 and 500 errors in CQ3.x or CQ4.x?

Solution

Edit the following config file:/config/delivery/scripting.xml and add your own error handler for status 404 or 500. For example:

Note: Keep the line <error status="*" script="/libs/Errorhandler/status.ecma" type="ecma" /> that exists and put your handler after it.

ESP Script

<errorhandler>
    <error status="*" script="/libs/Errorhandler/status.ecma" type="ecma" />
    <error status="404" script="/path/to/your/script.esp" type="ecma" />
    ...
</errorhandler>

JSP Script

<errorhandler>
    <error status="*" script="/libs/Errorhandler/status.ecma" type="ecma" />
    <error status="404" script="/path/to/your/script.jsp" type="jsp" />
    ...
</errorhandler>

See the Script Handler Reference page.

Note:

  • Be careful not to name your script starting with numbers in the name (for example, 404.jsp is an invalid name). See here for more info about this issue.
  • For your error page to be displayed in Internet Explorer and Google Chrome, the number of characters output by the response must exceed 1000. Otherwise, IE and Chrome output their default error page.

 Adobe

更快、更轻松地获得帮助

新用户?

Adobe MAX 2024

Adobe MAX
创意大会

10 月 14 日至 16 日迈阿密海滩及线上

Adobe MAX

创意大会

10 月 14 日至 16 日迈阿密海滩及线上

Adobe MAX 2024

Adobe MAX
创意大会

10 月 14 日至 16 日迈阿密海滩及线上

Adobe MAX

创意大会

10 月 14 日至 16 日迈阿密海滩及线上