Under what circumstances does SAP Spartacus display a 404 Not Found page?

Request content page with ID not found:

not-found.handler.ts:

Semantic route path notFound Corresponding URL Path: not-found

Then search for notFound keyword:

Found the canActivateNotFoundPage implementation of CMS-Page-guard.service. ts:

First call cmsservice.getPage to read the notFoundCms Page:

NotfoundPage is based on a template: ErrorPageTemplate:

Check whether canActivatePage:

The pageContext data structure contains the id and type: where ContentPage refers to the CMS page:

More of Jerry’s original articles can be found in “Wang Zixi” :