404 Error handling in AEM-React Integration (model.json is not called on 404 error page) | Community
Skip to main content
New Participant
January 7, 2022

404 Error handling in AEM-React Integration (model.json is not called on 404 error page)

  • January 7, 2022
  • 2 replies
  • 1912 views

We are on AEM-React SPA. We are implementing 404 error handling using Apache error directive. Here is the approach- When I make a request to non-existent page, publisher sends the default error page with 404 status to the Dispatcher for every Not Found resource, Dispatcher handover the error(404) processing to WebServer(Apache). The WebServer checks if the error page is in the cache, if not available then requests the custom error page from the publisher based on the ErrorDocument configurations and returns the error response to the users with the required 404 error code.

 

Issue Description

When a xyz page is not found, then apache internally makes the request to 404-error-page.html(based on error directive), and I see a request for xyz.model.json and en.model.json in the network tab, but I don’t see the request for 404-error-page.model.json (because html redirect is made internally by Apache). Due to which page is showing blank. And this is happening because react maps the url to the json. Is there any way to make a request to 404-error-page.model.json when the apache makes a request to 404-error-page.html internally.

 

Apache Error directive configuration

ErrorDocument 400 /404-error-page.html

 

@suraj_kamdi @vijayalakshmi_s @arunpatidar 

 

 

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

2 replies

aanchal-sikka
New Participant
November 1, 2023
arunpatidar
New Participant
February 9, 2022

Hi,

I have not implemented this but check if sling filter can help.

Arun Patidar