Dear community,
I've checked that error pages can be customized by creating the sling/servlet/errorhandler/error-type.jsp.
However, I'd like to customize the error page only for my project that is stored under "apps/my_region/my_project". (There are other projects under my_region and have their own error pages)
As expected, it doesn't work when I moved the sling/... folder under my_project. Would like to know if there is any approach to customize the error page for the project.
Thanks in advance!
Solved! Go to Solution.
Views
Replies
Total Likes
Considering your use case, you should handle error processing at the apache level.
What does it mean?
AEM returns standard error page (consider it as a very lightweight error page response). Idea is to keep error processing very light weight on AEM.
How should error handle work?
Create an error page in AEM like other pages of your site.
/content/path/to/your/site/home/errors/404.html /content/path/to/your/site/home/errors/500.html
Error response should be handed at the apache level. In your virtual host configuration, add a Document with the path of AEM page.
ErrorDocument 404 /content/path/to/your/site/home/errors/404.html ErrorDocument 401 /content/path/to/your/site/home/errors/500.html
How error processing will work?
/content/path/to/your/site/home/errors/404.html
How this approach will help?
AEM comes with a standard error handler for handling HTTP errors.
You can develop your own scripts to customize the pages shown by the error handler when an error is encountered. Your customized pages will be created under /apps and overlay the default pages (that are under /libs).
Also, you should look for ACS
https://adobe-consulting-services.github.io/acs-aem-commons/features/error-handler/index.html
Provide an author-able means for defining, creating and managing custom Error pages per content tree/site.
Considering your use case, you should handle error processing at the apache level.
What does it mean?
AEM returns standard error page (consider it as a very lightweight error page response). Idea is to keep error processing very light weight on AEM.
How should error handle work?
Create an error page in AEM like other pages of your site.
/content/path/to/your/site/home/errors/404.html /content/path/to/your/site/home/errors/500.html
Error response should be handed at the apache level. In your virtual host configuration, add a Document with the path of AEM page.
ErrorDocument 404 /content/path/to/your/site/home/errors/404.html ErrorDocument 401 /content/path/to/your/site/home/errors/500.html
How error processing will work?
/content/path/to/your/site/home/errors/404.html
How this approach will help?
Thank you for the reply, the information helps a lot!