Different DNS points to same server but access to a different directory

Issue When I entered domainB.com URL it will force a redirect to domainA.com or it would display the domainA content while the URL is showing domainB.com Expected Outcome I am expecting the domainA.com and domainB.com would display its own content respectively, which mean domainA.com showing the content in var/www/DomainA domainB.com showing the content in var/www/DomainB…

Details