CQ5.2.X to CQ5.3 Upgrade: Custom 404 handler causes 404 page to be returned for all pages


After upgrading from CQ5.2.X to CQ5.3 then all pages in our site return a 404 HTTP status.


If you have defined a custom 404 error handler in CQ5.2.X /apps/sling/servlet/errorhandler/404.jsp then it will override the custom 404 handler included out of the box in CQ5.3. This will cause all pages to return 404 statuses because your script will override CQ5.3's out of the box script.


To resolve this issue:

  1. Rename your custom 404 handler /apps/sling/servlet/errorhandler/404.jsp
  2. Copy /libs/sling/servlet/errorhandler/404.jsp to /apps/sling/servlet/errorhandler/404.jsp
  3. Adapt the out of the box script to do an include of your custom 404 handler. You may do this by replacing the bottom section with your 404 functionality.

    Bottom section of CQ5.3's 404.jsp (referred to above):
    // get here if authentication should not take place or if 
    // no Authenticator service is available or if no 
    // AuthenticationHandler is willing to authenticate 
    // So we fall back to plain old 404/NOT FOUND 
    // send 404 
    <title>404 Not Found</title> 
    <h1>Not Found</h1> 
    <p>The requested URL <%= request.getRequestURI() %> was not found on this server.</p> 
    <address><%= this.getServletConfig().getServletContext().getServerInfo() %></address> 

Applies to

CQ5.2.X to CQ5.3 Upgrade


Få hjelp raskere og enklere

Ny bruker?