The 5.7 branch of Magnolia reached End-of-Life on December 31, 2023, as specified in our End-of-life policy. This means the 5.7 branch is no longer maintained or supported. Please upgrade to the latest Magnolia release. By upgrading, you will get the latest release of Magnolia featuring significant improvements to the author and developer experience. For a successful upgrade, please consult our Magnolia 6.2 documentation. If you need help, please contact info@magnolia-cms.com.

When a user requests a non-existing page, the servlet container (Tomcat) or application server displays a 404 error page and returns the error code 404. You can configure what happens in the case of a 404 in the web.xml configuration file in the container.

A common solution is to create a custom error page that looks like the rest of your site, tells the visitor in clear terms that the page was not found, and provides some alternative ways to continue such as navigation and a search box.

<error-page>
   <error-code>404</error-code>
   <location>/error/404.html</location>
</error-page>

404 is not the only HTTP error code. You can set up landing pages for any of them the same way. See also How to setup a custom 404 handler on the wiki.

  • No labels