How to get an alert from AEM when a AEM page leads to a 404 error? | Community
Skip to main content
May 18, 2022
Solved

How to get an alert from AEM when a AEM page leads to a 404 error?

  • May 18, 2022
  • 4 replies
  • 2162 views

We noticed that some of our pages are going to 404 Error. However, we are not aware of this unless someone points this out.

So, wanted to check if there is something built in to AEM services that will send us alerts when a page on AEM leads to a 404 error.


Thanks.

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

What do you mean with "when some pages are going to 404 error"? Do you mean when something enters a URL which is not present in AEM and therefor returns a 404?

 

I would refrain from such a feature, because a simple typo and even some bot trying wordpress-style URLs on your AEM (which should always return a 404) will return a 404. If you implement an alert, that's a really nice way to spam your alert inbox.

 

Instead rather have a look into your dispatcher logfiles, extract all 404 requests and then periodically review these requests, extract patterns and decide if you want to implement either redirects, aliases or just create a page with the correct name at that location.

4 replies

May 19, 2022

@user09254  How did you guys implement the 404 error? ACS commons ? or custom implementation? 

 

 

shabarish
Level 2
May 19, 2022

Hi @user09254 ,

Create a custom 404.html under /apps/sling/servlet/errorhandler and using HTL call Sling model (ErrorHandlerRequestModel ) to handle 404 error. In the Sling Model define a logic such a way for every model call , AEM can send Notification or custom mail to specific user group. Hope this would be useful for you.

 

Please follow this blog to setup custom error pages

How to display custom site specific error(404,403 and 500) pages in multi site Adobe Experience Manager(AEM) setup? (albinsblog.com)

and this blog to send Notification

Send/Set AEM Notification without using workflow. | by Debal Das | Medium

 

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
May 19, 2022

What do you mean with "when some pages are going to 404 error"? Do you mean when something enters a URL which is not present in AEM and therefor returns a 404?

 

I would refrain from such a feature, because a simple typo and even some bot trying wordpress-style URLs on your AEM (which should always return a 404) will return a 404. If you implement an alert, that's a really nice way to spam your alert inbox.

 

Instead rather have a look into your dispatcher logfiles, extract all 404 requests and then periodically review these requests, extract patterns and decide if you want to implement either redirects, aliases or just create a page with the correct name at that location.

arunpatidar
Community Advisor
Community Advisor
May 19, 2022

Hi,

If this is for end user and redirect handler set at apache then you can get the logs from Apache httpd server and analyse the response.

From AEM also you can check the request logs and find out how many times you got 404.

 

Kibana or newrelic can help with the dashborad of all 404 pages and count  if you are using those.

Arun Patidar