Knowledge Base
Published Jun. 30, 2025

Virtual Host Not Working After Disabling VirtualHostFilter in Liferay DXP 7.3

Written By

Kanchan Bisht

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.

Issue

After configuring a virtual host in Liferay DXP 7.3, the /web/guest path segment cannot be removed from the site URL. Accessing the site without /web/guest results in the page continuously loading and a 404 error appearing in the logs.

Environment

  • Liferay DXP 7.3

Resolution

This issue is caused by the VirtualHostFilter being disabled in portal-ext.properties. Follow the steps below to resolve it.

  1. Stop the application server. Before making any changes to portal-ext.properties, stop the running Liferay instance.
  2. Update portal-ext.properties. Open {liferay_home}/portal-ext.properties and apply the following changes:
    1. Enable the Virtual Host Filter. Find the line below and either remove it entirely or set it to true:
      com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter=false

      Setting this to false disables virtual host routing and causes the 404 behavior.

    2. Set the default site for the virtual host. Add the following property to remove /web/guest (or any other site path) from the default URL:

      virtual.hosts.default.site.name=Guest

      With this property set, the default URL changes from http://localhost:8080/web/guest/home to http://localhost:8080/home. If the specified site has its own virtual host configured, that takes precedence; otherwise, the company virtual host is used.
    3. Clear cached data Delete the contents of the following directories before restarting:
      1. {liferay_home}/osgi/state
      2. {liferay_home}/work
      3. {liferay_home}/tomcat/temp
      4. {liferay_home}/tomcat/work
    4. Restart the application server. Start Liferay again. Changes to portal-ext.properties only take effect after a full server restart.
 

Additional Information

  • The portal-ext.properties file must always be updated while the server is stopped. Any changes made while the server is running will not be applied until a restart.
Did this article resolve your issue ?

Knowledge Base