We have two websites:
My task is to make the second one (Sitecore-based website) as a subsite of the first website, which is accessible via www.non-sitecore-site.com/sitecore-site.
I tried to make a virtual folder in IIS, convert it to a web application and set it up for the Sitecore-based site folder. However it does not work, even if I configure virtualFolder
and physicalFolder
both equal to "/sitecore-site" in Sitecore config files.
Is it actually feasible? Appreciate any help.
Sitecore resolves a site via a pipeline process within the httpRequestBegin
pipeline. The SiteResolver
sets a context site based on the following criteria:
Sitecore processes the config XML in sequence to find the first site matching the above criteria. Since each site has a hostName
attribute defined, Sitecore first checks against the hostName
then the virtualFolder
which by default is simply “/”. So, the first thing for you is to review a sequence of your site definitions to make sure that more specific configurations are placed on top and more generic ones - at the bottom.
To configure a Sitecore site as a virtual folder simply set the virtualFolder
and physicalFolder
attributes to the same value to match your expected path '/sitecore-site', i.e. your site configuration will look like:
<site name="yoursite" hostName="www.non-sitecore-site.com" virtualFolder="/sitecore-site" physicalFolder="/sitecore-site" ...
You don’t need to create neither a physical folder 'sitecore-sit' nor a virtual folder 'sitecore-sit' in IIS pointing to your Sitecore site.