Reputation: 664
I want to setup a sitecore solution containing multiple sites. The sites hostnames need to have the suffix language-culture, so I want the urls to be like:
[HOST]/de-DE
[HOST]/sv-SE
[HOST]/fr-BE
[HOST]/nl-BE
I tried to configure the sites with virtualpaths like "de-DE", but that does not help. How should this be configured?
And if I want the belgium site (fr-BE and nl-BE) to be one site with multiple languages (translations), but reachable from given url structure, how should that be setup?
Upvotes: 2
Views: 1033
Reputation: 13141
You may have better luck getting answers on https://sitecore.stackexchange.com/, however, I will answer here as I am unable to move your question.
It sounds to me like you need a mixture of both separate website nodes for each site, as well as translated versions within some of those sites (fr-BE and nl-BE).
As long as the site definitions are patched in before the website node, they should be picked up by Sitecore's site resolver based on the virtualFolder. Please note there is a special requirement when using virtualFolders in which the physicalFolder value must match. More info on that here.
<site name="fr-BE" ... virtualFolder="/fr-BE" physicalFolder="/fr-BE" rootPath="/sitecore/content" startItem="/Home Belgium" language="fr-BE" ... />
<site name="nl-BE" ... virtualFolder="/nl-BE" physicalFolder="/nl-BE" rootPath="/sitecore/content" startItem="/Home Belgium" language="nl-BE" ... />
<site name="de-DE" ... virtualFolder="/de-DE" physicalFolder="/de-DE" rootPath="/sitecore/content" startItem="/Home Germany" language="de-DE" ... />
<site name="website" ... virtualFolder="/" rootPath="/sitecore/content" startItem="/Home" ... />
Notice how the first two site definitions point to the same start item (/Home Belgium
in my example). This allows you to still use Sitecore's language version translation on that site, while keeping the item tree structure separate from the German site.
Next, you will need to turn off the strip language processor that is responsible for identifying and removing the language prefix from each request. This is on by default and will prevent you from using virtual folders that match a language code.
<!-- Set to false to allow language code virtual folders -->
<setting name="Languages.AlwaysStripLanguage" value="false" />
Lastly, make sure you have the proper languages installed and that your content is published in the appropriate languages.
Upvotes: 1