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.
Also, Sitecore provides the multi-site feature as an out-of-the-box feature. You can use this feature in case your client has a number of sites and they are willing to have everything on Sitecore, then using a single Sitecore license, you 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 are facing any issues loading a multi-domain website like in our case where we found one issue during the version upgrade, you need to add the site definitions with name and hostname attributes for each site in the ‘Stecore.config’ file below the site’s definition node.
** In our case, until this configuration hadn’t been done, we were facing issues where one site is targeted for all the sites even after configuring the above mentioned steps.
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.