31 Jul 2008
05 Aug 2008
Link to this post
I would like to use Sitefinity with two or more languages and be able to branch to the correct language content depending on the domain name.
The default language is set to 'en' other language could be 'es'.
We have two domain names: www.mysite.com and www.mysite.es
The idea is to branch to http://www.mysite.es/es/home.aspx when a user enters http://www.mysite.es/
Here is the web.config setting for localization :
<localization defaultProvider="Sitefinity" autoSetClientLanguage="False" persistenceMode="PathPrefix" defaultCulture="en" cultures="en, es, fr, de, bg">
I tried to default culture is Global.asax Session_Start handler by setting the culture depending on the domain name:
void Session_Start(object sender, EventArgs e)
// If domain ends with .es
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("es-ES");
Should I use the Telerik.Localization to do the trick?
I found a solution on the forum using a user control in the home page to redirect to the selected page.
It means that when I enter 'http://www.mysite.es' I get redirected to 'http://www.mysite.es/en/home.aspx' by Sitefinity logic and then redirected to 'http://www.mysite.es/es/home.aspx' by the user control.
Another question, could is be possible not to have any language prefix and have the language set by the domain name, like if the default language would be set by the domain name?
Thank you in advance for your support.