Legacy Knowledge Base
Published Sep. 10, 2025

Page not found (404) redirects to the 'default' (Guest) web site

Written By

Prarthana Jadhav

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

  • When an incorrect URL is hit on the portal, the "The requested resource could not be found" error or Page not found error redirects to the default site and not to that particular site.

Environment

  • Liferay DXP 7.0

Resolution

  • The observed behaviour is an intended behaviour of Liferay.
  • The reason behind this intended behaviour is when an incorrect URL is hit, it should land on a page giving an appropriate message. By default, the landing page for this is the Guest site and hence it redirects to Guest/Default site.

Additional Information

  • If the requirement is to make Liferay go to site-specific 404 pages.
    • You'll need to create your own 404 HTML page first. Once you do so, you can point Liferay to use it with these two properties:
          #
          # Redirect to this resource if the user requested a friendly URL of a page
          # that does not exist. Leave it blank to display nothing.
          #
          # A similar configuration for sites is managed with the property
          # "sites.friendly.url.page.not.found".
          #
          # Note: For backward compatibility, this overrides the property
          # "layout.show.http.status" for the 404 status code.
          #
          #layout.friendly.url.page.not.found=/html/portal/404.html
          #
          # Redirect to this resource if the user requested a site friendly URL that
          # does not exist. Leave it blank to display nothing.
          #
          # A similar configuration for pages is managed with the property
          # "layout.friendly.url.page.not.found".
          #
          #sites.friendly.url.page.not.found=/html/portal/404.html
      If Tomcat application is being used, the location specified in the properties would translate to your physical directory to be something like /tomcat-9.0.17/webapps/ROOT/html/portal.
Did this article resolve your issue ?

Legacy Knowledge Base