Legacy Knowledge Base
Published Jul. 2, 2025

What to expect if the company.default.home.url is set as "/"

Written By

Brian Suh

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  • This article provides a high-level overview of what to expect if the company.default.home.url is set as /.

Environment

  • Liferay DXP with sites or instances with multiple virtual hosts

Resolution

  • Let's say that your Liferay DXP instance has the following setup:
    • Two sites with the following Public Pages Virtual Host
      • Liferay Test 1 with the Public Pages Virtual Host of liferay-test1.com
      • Liferay Test 2 with the Public Pages Virtual Host of liferay-test2.com
    • The company.default.home.urlproperty is set as / (it is set to /web/guest by default)
    • Both sites include a Public Page, which contains a Web Content article including a link to / as follows:
      • <p><a href="/">Test Link</a></p>

Here's what we should expect:

Please bear in mind that this behavior also applies to a theme's ThemeDisplay.getURLHome().

One additional note is that the web.server.host property will affect the host/server resolution logic. When we define a specific hostname in the web.server.host property, Liferay will enforce this specific hostname to be used when generating URLs. As noted in the default portal.properties, leaving this property blank (i.e., web.server.host=) will mean that the host is derived from the servlet container. If the web.server.host property is blank, we should expect the aforementioned behavior where / will be relative to the hostname in which it was requested.

 

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base