How to disable language embedding in URLs in Sitecore?

After setting up a simple Sitecore site, page links sometimes contain the current language:

http://example.com/item.aspx
http://example.com/en/item.aspx

I would like to disable this behavior so that all links point to http://example.com/item.aspxwithout language as part of the path. How can I do that?

+5
source share
2 answers

Web.config has a configuration parameter for <linkManager>where you can configure the parameter languageEmbedding:

<linkManager defaultProvider="sitecore">
    <providers>
        <clear/>
        <add name="sitecore" ... languageEmbedding="asNeeded" ... />
    </providers>
</linkManager>

Parameters languageEmbedding:

  • asNeeded
  • is always
  • never

Changing the configuration for use languageEmbedding="never"will result in the language not appearing in the URL, and also languageEmbedding="always"causing the language to always appear in the URL.

+21
source

"asNeeded", URL- . "", "", SEO

+8

All Articles