A single Sitecore instance uses multiple websites to manage content delivery, content management, and many other features. However, by default there is only one published website. This website corresponds to the <site name="website"…/> definition in the ‘Sitecore.Sites.config’ file.
Moreover, Sitecore provides multi-site as an out-of-the-box feature. We can use this feature in case our client has a number of sites and he/she is willing to have all on Sitecore then using one Sitecore license, we can configure all these sites with minimal effort.
In this blog, I will brief you on what configurations we need to do so we can quickly set up multisite in Sitecore with the single Sitecore instance.
Create the Site definition nodes in a patch config file in path ‘\App_Config\Include\’ for the websites and also define the specific ‘hostname’ & ‘targetHostName’ attributes for each website.
Please refer to the below images:
Add your site hostname in the IIS binding.
**Note: Sitecore 10 supports ‘https’ bindings only.
Add your site hostname in hosts file (under WINDOWS\System32\drivers\etc\folder)
That’s it. It will work.
But still, if you face any issue loading a multi-domain website like in my case we found one issue during Sitecore version upgradation, we need to add the site definitions with name & hostname attributes for each site in the ‘Sitecore.config’ file below the sites definition node.
**In my case, until this configuration hadn’t been done, I was facing the issue that one site is targeted for all the sites even after configuring the above-mentioned steps configuration.
We are done with the multisite configurations in Sitecore 10 Instance and we can verify after restarting the instance in IIS.
** It is recommended to keep the Rendering.SiteResolving setting value at “true” for any multisite solution in order to ensure that cross-site links are built with the correct parameters.