Legacy Knowledge Base
Published Sep. 10, 2025

How to Configure Multiple Site Names with Different HostNames

Written By

Prarthana Jadhav

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

  • How Multiple Sites can be configured with Different HostNames in the portal? The below example illustrates the requirement.
    If there are two sites Site A and Site B then,
    1) Site A should be mapped with a.site.com
    2) Site B should be mapped with b.site.com 
  • That is when www.a.site.com:8080 is hit, it should redirect to Site A

Environment

  • Liferay DXP 7.2

Resolution

  • The hostnames can be configured by following the below steps. 
    1) Create two sites named "Site A" and Site B
    2) Map the Server IP with "a.site.com" and "b.site.com" hostname in the Operating System's hosts file (/etc/hosts file). 
    3) Navigate to Site A-> Site Administration-> Configuration > Site Settings > Site URL and enter "a.site.com"-> Save.
    4) Enter Site URL as b.site.com for Site B.
    5) Now, access www.a.site.com:8080, it will redirect you to Site A and b.site.com:8080 will redirect to Site B. 
  • In this way, different sites can be configured with multiple hostnames in the same portal.
Did this article resolve your issue ?

Legacy Knowledge Base