SaaS CMS has officially launched! Learn more now.

Customising Language prefix in url


Hi all,

Is there a way to control the language prefix in a globalised site such that '/uk/' is displayed in the url instead of '/en-GB/'?

if so, any help or pointers would be greatly appreciated.

Thank You

Jul 20, 2011 11:48

Go in to cms admin, click "Manage Website Languages" under the config tab. Then select your language and define a value for "Web address prefix".

Jul 20, 2011 13:30

Hi Linus and thank you for your response.

If I set a uk variant to have the web prefix of 'uk' in Admin mode, is there some way in code to access the web prefix via the framework API instead of url parsing?

Thank You

Jul 21, 2011 16:39

This is depending on the place where you need to access the language code. If you have the language branch loaded you should of course get hold of this prefix. The language branch could be loaded from the PageData.LanguageBranch property.

If you have a link and want to determine the language branch it's a bit more trickier but if your code is running before the friendly URL-parser then you can look for the value of the epslanguage query string parameter. I would assume that this has the id of the language branch that you can use to load it and determine the URL segment for the language branch.

Jul 27, 2011 17:50

Hi Linus!

If the page has a fallback language how can we get the web address prefix for the preferred language?

I've found the ContentLanguage.PreferredCulture, but how do I go from there to the prefix?

Sep 26, 2012 18:21

I can answer my own question;


Sep 26, 2012 18:26
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.