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

404 error handling

Avatar

Level 3

Hi,

I have added custom error scripts in /apps/sling/servlet/errorhandler(404.jsp,default.jsp).

If I try to request below page on AEM 6.1 instance which doesn't exist:

https://localhost:4502/es_ES/hello  -    my personalized 404 page is displayed.

But if i request below page :

https://localhost:4502/hello            -    no error is showing up. Page is coming blank.

In httpd.conf i am configuring my error document like below:

<LocationMatch> \.html$

ErrorDocument <path of the error page>

</LocationMatch>

Please help me in resolving this issue. 404 page needs to be effective at the root context also.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Sure Kautuk,

We basically used ACS Common for error handling.

I have used following sling:OsgiConfig to configure the Error Page Handler.

/apps/myapp/config/com.adobe.acs.commons.errorpagehandler.impl.ErrorPageHandlerImpl.xml

     It has a property named error-page.system-path.

This property was not pointing to the error page that I have created under my project in siteadmin, because of which it was showing the blank page.

For reference, how to do error handling using ACS AEM Commons please go through below link:

https://adobe-consulting-services.github.io/acs-aem-commons/features/errorpagehandler.html

-Akshita

View solution in original post

4 Replies

Avatar

Level 2

You can use the resource resolver[1] to check how these 2 paths are getting resolved. Sometimes you might have some alias or vanity url pointing to /hello

 [1] http://localhost:4502/system/console/jcrresolver

Avatar

Level 3

Thanks for the input Ashok. Problem have been resolved.  :)

Avatar

Administrator

akshitaa82720401 wrote...

Thanks for the input Ashok. Problem have been resolved.  :)

 

Hi

Can you please share the solution for benefit of community ?

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Correct answer by
Level 3

Sure Kautuk,

We basically used ACS Common for error handling.

I have used following sling:OsgiConfig to configure the Error Page Handler.

/apps/myapp/config/com.adobe.acs.commons.errorpagehandler.impl.ErrorPageHandlerImpl.xml

     It has a property named error-page.system-path.

This property was not pointing to the error page that I have created under my project in siteadmin, because of which it was showing the blank page.

For reference, how to do error handling using ACS AEM Commons please go through below link:

https://adobe-consulting-services.github.io/acs-aem-commons/features/errorpagehandler.html

-Akshita