Implementing a Custom 404 Error Page in a Sitecore XM Cloud Multi-Site Project
Hello everyone, in this blog we will see how we can implement our custom 404 error page in XM Cloud project. This blog is very helpful when you are working in multisite solution with single Front End project. It means in front end, we have single repository only. XM Cloud starter repo comes up with default 400 and 500 pages but there is limitation with next js implementation. You can find detail discussion for error page limitation in this github channel here In Sitecore documentation also, its clearly mention about the same. Let me give a small information about what's the limitaion. When any page you search which is not available on your site, the page is redirected to Next JS 404 page. This 404 page then internally calls the GraphQLErrorPagesService class which internally calls grapghql query to fetch the error page configured for your site in Sitecore. This is implemented using component level data fetching. So when the page build happens for SSG, it is unable to identify wh...