Legacy Knowledge Base
Published Jun. 30, 2025

Modify the URL to remove /w when using a display page template for web content

Written By

Amit Tiwari

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

  • If you are using a display page template to display the web content data on the page then it will generate the URL as like "https://localhost_or_domain:port/w/WCTitle". 
  • In order to make SEO friendly URL, there might be a requirement to remove /w from the existing URL(https://localhost_or_domain:port/w/WCTitle).

    Steps to reproduce:

    1. Go to Design--> Page Templates--> Display Page Templates and add a display page template: Provide a sample template name, and select the content type: Web Content Article. Subtype: Basic Web Content.
    2. Add a web content display widget, then publish the display page.
    3. Go to Content & Data --> Web Content --> and add basic web content "WC1". Make sure that the display page template is set as the display page from the right-side panel, then publish the content.
    4. Go to the created web content and click on view content from the 3 ellipsis dot option of the content. copy its friendly URL

Environment

  • Liferay DXP 7.4 U31

Resolution

  • Modifying the URL including the "/w" is not possible with OOTB configurations because the "/w" is the constant value written in the Liferay source code which makes it as intended behavior of the portal.
  • As the "/w" is the constant value defined for the URL separator of the web content that is displayed via the display page template. This has been defined in the "FriendlyURLResolverConstants" class in the below code lines. To modify, you can override the code to meet your needs by customizing it accordingly.
    package com.liferay.portal.kernel.portlet.constants;
    import com.liferay.portal.kernel.util.Portal;
    public class FriendlyURLResolverConstants {
    ............
    public static final String URL_SEPARATOR_JOURNAL_ARTICLE = "/w/";
    .............
    public static final String URL_SEPARATOR_Y_PORTAL_RESERVED =
    URL_SEPARATOR_X_PORTAL_RESERVED.substring(1);
    }
    Also, In the URL, after the constant value "/w" it's appended with $WC_Title. This may be modified from the UI configurations using the OOTB  feature for the specific web content to ensure uniqueness. Please refer here for more information:https://learn.liferay.com/dxp/latest/en/site-building/displaying-content/using-display-page-templates/publishing-content-with-display-pages.html
    • Edit the existing web content, friendly URL section is available under the settings basic information which allows you to modify it.
  •  A feature request addressing this case will be implemented and supported by Liferay in a future release: https://liferay.atlassian.net/browse/LPS-181894 (customization for "w" in the URL when the display page template is used). If you would like to inquire about the feature request, please post your questions here:
    https://liferay.dev/ask/questions/feature-requests
Note: The proposed solution can be achieved through customization, so it should be performed by the customer's Developer Team at their discretion. If further assistance is required, please reach out to our GS (Global Services) Team.
Did this article resolve your issue ?

Legacy Knowledge Base