Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

View solution in original post

4 Replies

Avatar

Level 1

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

 

 

Avatar

Level 3

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 Mana...

and this blog to send Notification

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

 

Avatar

Correct answer by
Employee Advisor

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.

Avatar

Community Advisor

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