1

In our project we have a single sitecore root path but the client has configured the same root path in sitedefinitions.config with 4 different domain names. Is this correct?

In the above context can the site be considered as a multi site solution? My understanding is that for a solution to be multi site you need to have multiple root paths in sitecore for example the below sitecore structure.

enter image description here

However we do not have two root paths but still we are using 4 different settings in our site definition. Is this correct?

Following is the way we are using site definitions in our configuration file.

<site name="www.example.org" patch:after="site[@name='modules_website']" 
targetHostName="www.example.org" hostName="www.example.org" database="web">

<site name="example.org" patch:after="site[@name='modules_website']" 
targetHostName="example.org" hostName="example.org" database="web">

<site name="www2.example.org" patch:after="site[@name='modules_website']" 
targetHostName="www2.example.org" hostName="www2.example.org"database="web">

<site name="example" patch:after="site[@name='modules_website']"        
targetHostName="beta.example.org"hostName="beta.example.org"database="web">

The difference between the four configurations is that the last three targetHostName redirect to the first one. I do not understand if this can correctly be called a multi site solution as in actual there are no multiple sites in our Sitecore instance.

  • 1
    Why would you have 4 site definition with the same root path? You can set multiple domain names in 1 site definition as well if needed... And whether you call this multisite or not might be a matter of opinion - but if there are no differences between the domains, it's not. – Gatogordo Feb 27 at 12:21
  • I think the only reason why you could have multiple site definitions pointing to the same root path would be when you need different host names for different languages with the content running from the same root path. And in fact I would call it a multisite solution in that case – Marek Musielak Feb 27 at 12:26
  • @MarekMusielak I have added further information regarding the Site definition sin the question. What are your thoughts about the same? – Shomila Feb 27 at 13:21
  • @Gatogordo I have added further information regarding the Site definition sin the question. What are your thoughts about the same? – Shomila Feb 27 at 13:22
3

You wrote that:

The difference between the four configurations is that the last three targetHostName redirect to the first one

So your configuration looks similar to:

<site 
    rootPath="/sitecore/content/Website1" 
    startItem="/home" 
    targetHostName="www.example.org" 
    hostName="www.example.org" ... />
<site 
    rootPath="/sitecore/content/Website1" 
    startItem="/home" 
    targetHostName="www.example.org" 
    hostName="example.org" ... />
<site 
    rootPath="/sitecore/content/Website1" 
    startItem="/home" 
    targetHostName="www.example.org" 
    hostName="www2.example.org" ... />
<site 
    rootPath="/sitecore/content/Website1" 
    startItem="/home" 
    targetHostName="www.example.org" 
    hostName="beta.example.org" ... />

In this scenario, it doesn't matter if user use www.example.org or example.org or www2.example.org or beta.example.org host name in the url in the browser, they will see exactly the same content.

And all the links generated there will link to targetHostName domain which is www.example.org;

The same can be achieved using pipes separated list of hostnames in a single site config:

<site 
    rootPath="/sitecore/content/Website1" 
    startItem="/home" 
    targetHostName="www.example.org" 
    hostName="www.example.org|example.org|www2.example.org|beta.example.org" ... />

So in fact you could say that this is a single site solution, not a multi-site. But it's just naming.

| improve this answer | |
  • Thanks for the clarification. Query cleared! – Shomila Feb 27 at 14:04
  • I would say that there are downsides to having multiple sites, though. Lots of things, like HTML caches for one, are setup per site. It would be inefficient to have 4 sites configured just for different hostnames. – Matthew FitzGerald-Chamberlain Feb 27 at 20:06
  • I totally agree.Don't understand me wrong - I don't suggest anyone should have the setup with multiple sites configured as in the example above. Unless there is some special reason to do this. – Marek Musielak Feb 27 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.