Is there a way to customize URLs by Web Content Structures?
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
- We would like to know if there is a way to customize URLs by web content structure for SEO purposes.
- Currently, friendly URLs for web content use the
/w/ separator, which can be customized since 2024.Q2. See Configuring Friendly URL Separators .
- However, there is a need to further specify the content type in the URL to enhance SEO.
Resolution
-
Currently, there's no built-in feature to customize friendly URL separators individually for each web content structure. While blog posts allow adding the category to the URL (LPD-6814), similar functionality is not yet available for web content.
- As a workaround, you can manually include the desired separator (e.g., the content type) in each web content's friendly URL.
- For example, to achieve a URL like
/web/mysite/w/structure-name/mycontent, set the friendly URL of the "mycontent" web content to structure-name/mycontent.
- Keep in mind that this is a manual process and might be difficult to maintain, especially with a large amount of content.
-
Alternatively, you can use Display Page Templates via direct links, allowing you to use the Display Page URL instead of the web content's FriendlyURL (Setting a Friendly URL for the Display Page Template).
- However, the URL follows this format
/web/mysite/e/{userDefinedURL}/assetTypeId/assetId, so it would be something like this: /web/mysite/e/mydisplaypage/194105/3265738, and that may not meet your needs either.
- The Product team is aware of this need (LPD-43195) and is considering providing more flexibility and control over friendly URLs, including custom prefixes for different web content structures in the future. However, there's no estimated timeline for this feature.
did-this-article-resolve-your-issue