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
learn-legacy-article-disclaimer-text
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
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