Liferay is not redirecting to the custom error page


  • A static page in Liferay has been built with the following property to

    Hit the URL:  https://xyz/web/error/error404 (just for demonstration purposes here)
    The Liferay resource not found error page will be visible, along with the search bar and the sign-in portlet.
    Expected Behavior: The application should route to the error page after hitting this URL.


  • Liferay DXP 7.4


  • To avoid conflicts with this, be sure to specify both properties for the error page: and both to /web/error/error404 in the file.
    • Any URL that contains /web will redirect to a public site if it exists, or an error page if the site does not exist. A friendlyURL for a specific page would be /web/<groupFriendlyURL>/<pageFriendlyURL>.

Additional Information

  • To test this use case, the value can be the same as Thus, the following are steps that can be taken in vanilla instance:
    1. Start Liferay with a fresh database.
    2. Go to Control Panel > Sites
    3. Create a new site named error
    4. Create a web content named 404
    5. In the new error site, Go to Site Builder > Pages > create a page titled error404.
    6. Configure  friendlyURL of the error404 page to be /error404
    7. Place a web content display on your error404 page and select your 404 content.
    8. Shutdown the portal and set the and both to /web/error/error404 in
    9. Restart Liferay
    10. Type any random url after localhost:8080 and notice users are redirected to the error404 page with your web content.
0 人中有 0 人觉得有帮助