Legacy Knowledge Base
Published Jun. 30, 2025

Hardcoded link resulting in 404 error

Written By

Dia Seung

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

  • I have a hardcoded button to a web content that is now going to a 404 page.
  • My link to Liferay content is now breaking.

Environment

  • DXP 7.4
  • Quarterly Release

Resolution

  • Hardcoding links to Liferay content can break if any changes are made to the URL and are not considered best practice.
    If changes are made, such as changing the friendly URL or applying Display Page Templates, the URL to the content may change, and cause hardcoded links to result in 404 pages instead.
    Instead, please consider mapping the fragment to the content instead.

Example steps for mapping a button to link to a Basic Web Content (with a Display Page Template applied) would be as follows:

  1. Place a button on a page.
  2. Select the button, and then select 'link' in the left-hand column.
  3. [To change the text of the button] On the Mapping tab, click on the 'Item' field and select the appropriate Basic Web Content. For 'Field', select the appropriate field type (i.e. 'Title').
  4. [To change the link of the button] On the Link tab, click on the 'Link' field and select 'Mapped URL'.
  5. For 'Item', select the appropriate Basic Web Content. For 'Field', select a Display Page.

Additional Information

 

 

Did this article resolve your issue ?

Legacy Knowledge Base