Skip to main content
Level 2
Oct 17, 2024 8:44 AM UTC

Show Custom 404 error message

Hi Team,
I only want to show custom 404 error message for my site having path "/content/mySite/".

I have overlayed "/libs/sling/servlet/errorhandler/" but this is working for every path.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

sateaswa94
Level 3
Oct 17, 2024 10:43 AM UTC

Hi @viveksr1 
It is ideal to use same error page for all content tree and you can configure in dispatcher if you need locale specific error page. If there is any requirement for content tree specific error page then use acs commons error handler https://adobe-consulting-services.github.io/acs-aem-commons/features/error-handler/index.html

Translate
narendragandhi
Community Advisor
Community Advisor
Oct 17, 2024 10:44 AM UTC

Hi @viveksr1 

 

You are right, overlaying the OOTB servlet handler will do this across the environment. Instead you can leverage the ACS AEM Commons Error page handler for this requirement. Refer below links for details -

 https://adobe-consulting-services.github.io/acs-aem-commons/features/error-handler/index.html

https://medium.com/@toimrank/aem-acs-commons-error-page-handling-a84549761260

 

Thanks

Narendra

Translate
VivekSr1Author
Level 2
Oct 29, 2024 6:36 AM UTC

Hi @narendragandhi ,

I follow the process and did the same .
After deploying my changes 404 is coming as configured but It is conflicting my authoring environment like configuration icon is not showing. Please help.

Translate
MukeshYadav_
Community Advisor
Community Advisor
Oct 17, 2024 11:51 AM UTC
kautuk_sahni
Level 9
Nov 5, 2024 2:37 PM UTC

@viveksr1 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Translate
Kautuk Sahni
VivekSr1Author
Level 2
Nov 6, 2024 6:25 AM UTC

Hi @kautuk_sahni ,

 

Yes I have configured 404 and its working in Author only but not in Publish.
In publish it is showing error like 404.jsp is not found.

Translate