8

After setting up a simple Sitecore site, links to pages 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.aspx without the language as part of the path. How can this be done?

2 Answers 2

28

The web.config has a configuration setting for <linkManager> where the languageEmbedding option can be configured:

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

The languageEmbedding options are:

  • asNeeded
  • always
  • never

Changing the config to use languageEmbedding="never" will stop the language from showing up in the URL, and likewise languageEmbedding="always" will force the language to always show up in the URL.

Sign up to request clarification or add additional context in comments.

2 Comments

what will asNeeded do? Correct me if i'm wrong - my research so far suggests that it's a placeholder telling sitecore you'll create your own linkmanager to check whether it's needed. The default Sitecore linkmanager treats it the same as never.
asNeeded embeds language when no language cookie is found
11

You should not use the "asNeeded" option as it might cause multiple urls for the same pages. Use either "never" or "always" which is much more SEO-friendly

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.