Sitecore Multilingual Sites: How to Configure Sitecore for Multiple Domains

If you have chosen to the multiple domain path to implement your multilingual sites, either on your own or based on my previous post, Single Domain vs. Multiple Domain Implementation, the good news that it’s more configuration than development, with the bulk of it being done inside the web.config.

This was tested on Sitecore v6.1, so please perform ample testing when working with other versions.

Default Web.config Sites Section

<sites>
   <site name="shell" ... />
    <site name="login" ... />
    <site name="testing"... />
    <site name="admin" ... />
    <site name="service" ... />
    <site name="modules_shell" ... />
    <site name="modules_website" ... />
    <site name="website" ... />
    <site name="scheduler" ... />
    <site name="system" ... />
    <site name="publisher" ... />
</sites>

Your new site entry will go above <site name=”website”>. I didn’t think the order mattered, but according to a Sitecore engineer who helped me debug my issues, it does. It’s a bug in v6.1, which may or may not have been fixed in newer versions.

The Modification – <sites>

<site name="website-uk" targetHostName="www.yoursite.co.uk" hostName="www.yoursite.co.uk" language="en-gb" ... />
      <site name="website" targetHostName="www.yoursite.com" hostName="www.yoursite.com" language="en" ... />

You should also clone the entry for cache sizes.

<cacheSizes>
      <sites>
        <website>
          <html>10MB</html>
          <registry>0</registry>
          <viewState>0</viewState>
          <xsl>5MB</xsl>
        </website>
        <website-uk>
          <html>10MB</html>
          <registry>0</registry>
          <viewState>0</viewState>
          <xsl>5MB</xsl>
        </website-uk>
      </sites>
    </cacheSizes>

The <linkManager> manager section also has some modifications. I have changed languageEmbedding to “never,” as it’s not necessary with multiple domains and is also better for SEO not to duplicate your content with multiple access via www.yourdomain.com/mypage.aspx and www.yourdomain.com/en/mypage.aspx going to the same place. I have also changed alwaysIncludeServerUrl to false, as it was causing some incorrect linking in some places.

<add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel" addAspxExtension="true" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="never" languageLocation="filePath" shortenUrls="true" useDisplayName="false" />

Finally, I’ve had to set Rendering.SiteResolving to false as it was also causing issues with links on www.mysite.com showing up as www.mysite.co.uk

<setting name="Rendering.SiteResolving" value="false" />

That’s really it. It took many days and a lot of trial-and-error testing, but I’m happy to say my sites are up and working without a hitch. Hopefully, you will find this useful as well. But please remember – test everything.

8 thoughts on “Sitecore Multilingual Sites: How to Configure Sitecore for Multiple Domains

  1. Hi Max,
    Great article! I followed couple of articles from SDN, but unfortunately could not configure the multi-site configuration.
    Steps:
    1) web config – site entries
    2) Cache entries
    3) Add nodes under content
    4) add DNS entries to IIS site (All to same IIS site)

    Issues:
    I can preview the new nodes, but when I tries to published the site I get following error:
    Job started: Publish to ‘web’|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.UriFormatException: Invalid URI: The format of the URI could not be determined.
    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
    at RedirectManager.Pipelines.PublishItem.Processor.Process(PublishItemContext context)
    …….

    Do you have any idea? What configurations I have missed?

    Sanjay

    • couple of questions:
      1) what version of Sitecore are you on? If 6.3 or below, are you using the Staging module?
      2) do you have your hostName and targetHostName set up correctly in web.config? You don’t need http:// in front; just http://www.contoso.com

      Preview mode doesn’t look at your hostName/targetHostName settings, as it just uses queryStrings to switch out languages, so I am pretty sure it’s an issue w/ your sites entries

      • Thanks for reply, I “was” using 6.4.x, could not resolve issues :(
        I tried to upgrade ans something must have gone wrong.

        Luckily I was in initial phase of project so I just start over… :)
        Clean 6.5 (Update 5) install resolves all the issues.

        Sanjay

  2. Thanks for the article.

    I just upgraded to 6.5 it’s the ordering that caught me out still sigh.

    Instead of hostName or targetHostName variables you can have domain=”" which is what I use.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>