Force a language prefix in the url with Sitecore

asp.net-mvc, sitecore, sitecore7

Solution

Another way to use is our SEO Friendly URL Module.

This module implements a custom `LinkProvider` that provides SEO Friendly URL's and forces items to be accessed through their friendly URL. So if an item is accessed without the language code in the URL (e.g. `/my-item`) the module will 301 redirect to the URL with language code (e.g. `/en/my-item`). That is, if you have configured it to force friendly URL's (`forceFriendlyUrl="true"`) and set `languageEmbedding="always"`.

We use that module on our corporate website, so take a look at that to see it in action.

Problem

Is there a setting to force the language in the URL? Like, if I browse to http://www.site.com, I should be redirected to http://www.site.com/en, as it is now I can see the start page without the language prefix. The `LinkManager` is configured to always put in the prefix so all the links look fine at least.

Original source