legacy-knowledge-base
公開されました 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

learn-legacy-article-disclaimer-text

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