Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM Custom error 404/502 pages redirection.

Avatar

Level 1

Hi, Team.

Hope you are doing great.  

we are working on AEM 6.4(SP2) and multi-tenant. We have 5 projects on one jar.we are 5th place at multitenant project. our project  Now We got the requirement like develop custom 404 and 502 pages. Moreover, those error pages content is more specific about my project errors.  Now If I want to display my error pages if in my application content structure might be they hit the wrong URL.imagine that page is not available.  this time we have to show the error 404-page content. Make sure that it will not impact the remaining 4 other projects in multi-tenant. I mean they are dependent on by default 404 error like. 

<html data-sly-use.responseStatus="apps.sling.servlet.errorhandler.ResponseStatus">

<head>

<title>File not found</title>

</head>

<body>

    <p>A custom errorhandler for 404 responses</p>

</body>

</html>

Now if we hit any error page. we are getting this  A custom error handler for 404 responses.     coming to my question if I want to display my own error pages for my project. what are the steps I have to follow? Please let me know. without chanig the URL how can we show these pages.

This is the error 404 page:

1797393_pastedImage_4.png

502 page :

1797392_pastedImage_2.png

Path: /apps/sling/servlet/errorhandler/404.html

Best.

Hari.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor