Legacy Knowledge Base
Published Jul. 2, 2025

Redirecting Users to a Custom Page for Error Code 404

Written By

Laura Li

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The purpose lt of this article is to provide instructions on how to redirect users to a custom page in case of error code 404; instead of displaying the default page. 

Environment

  • DXP 7.0+

Resolution

There are two alternative approaches:

  1. With a custom site page:
    • Create a page from Site Administration where the user will be redirected when accessing a non-existing page. For example: /web/guest/page404.
      • Note: When the page is created, you can choose Hide from Navigation Menu so that it will not display in the navigation menu.
    • Set the property's value to the created page in the portal-ext.properties file:
      layout.friendly.url.page.not.found=/web/guest/page404
  2. With a custom JSP page:
    • Create a custom JSP page and place it in /webapps/ROOT/html/portal a directory. For example: 404.jsp.
    • Set the property's value to the created page in the portal-ext.properties file:
      layout.friendly.url.page.not.found=/html/portal/404.jsp

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base