Build correct URL for hostname routes