Muhammad Ali Khan
Muhammad Ali Khan

Reputation: 3

How to use culture code name as subsite in sitecore

I am trying to use culture code name ("fr, lb, ru") as subsite in sitecore www.mydomain.com/ru, Site is working fine but content is not being shown

giving this message

"The current item does not have a version in "Russian : русский". To create a version, click Add a New Version or click Add on the Versions tab."

my site configuration is

Please help me to use "ru, fr, sa, lb" as subsite names in sitecore.

Thanks.

Upvotes: 0

Views: 165

Answers (2)

jammykam
jammykam

Reputation: 16990

If you don't want Sitecore to interpret the first part of the URL as language code and to instead resolve to an item in the content tree then you can change the following:

<setting name="Languages.AlwaysStripLanguage" value="false" />

This prevents the StripLanguage processor in preprocessRequest pipeline from removing the language from the path and rewriting the URL.

You should also update the settings of the LinkProvider and set languageEmbedding=false.

You can read more details in this blog post: Prevent the Sitecore ASP.NET CMS from Interpreting URL Path Prefixes as Language Names

Upvotes: 1

Matthew Dresser
Matthew Dresser

Reputation: 11442

I think the problem here is that the LanguageResolver pipeline handler expects the language part of the URL to correspond to the full language name. So in your case it would expect www.mydomain.com/ru-RU. It is quite simple to create a custom LanguageResolver inheriting from the Sitecore one which is in Sitecore.Kernel.dll. The config element is

<processor type="Sitecore.Pipelines.HttpRequest.LanguageResolver, Sitecore.Kernel"/>

which you would need to patch to reference your new class. Your new class would override the Process method.

Upvotes: 0

Related Questions