404 Error handling in AEM SPA | Community
Skip to main content
Level 6
April 19, 2023
Solved

404 Error handling in AEM SPA

  • April 19, 2023
  • 2 replies
  • 3351 views

When a abc 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 abc.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. 

 

Apache Error directive configuration

ErrorDocument 404 /content/en/us/error/404-error-page.html

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 aanchal-sikka

@iamnjain 

 

It seems to be supported on AEMaaCS 

 

Saying based on this comment on https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/2869

 


@iamnjain  It appears, @leela-pavan-kumar is also referring the same documentation and noticing an issue Re: AEM SPA Error Page Handler - Adobe Experience League Community - 444452

 

May be you both can help each other. Please do share with us your final approach. Would be good to know. Thanks !

2 replies

ManviSharma
Adobe Employee
Adobe Employee
April 22, 2023

Hi,

Since the request for 404-error-page.model.json is not being made, it could be possible that the model for the 404 error page is not being initialized properly.

One possible solution is to explicitly initialize the model for the 404 error page in the 404-error-page.html file. You can do this by including a script tag in the HTML file that initializes the model for the page.

iamnjain
Community Advisor
Community Advisor
November 1, 2023

@manvisharma 

The same issue we are facing.

Can you please explain with an example sample code snippet?

That will help.

 

Any help here @aanchal-sikka @tanika02 @arunpatidar

@kautuk_sahniAny help here, please.

aanchal-sikka
Community Advisor
Community Advisor
November 1, 2023

Hello @iamnjain 

 

requesting you to please refer to: AEM Spa editor - Error Page handling (aemfrontend.blogspot.com)

Aanchal Sikka
iamnjain
Community Advisor
Community Advisor
November 1, 2023

@ronnie09  were you able to resolve this issue?