LPS-43510 improve canonical/alternate urls when using a portalDomain and virtualhost is localhost