1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Set current language depending on domain name

Set current language depending on domain name

3 posts, 0 answered
  1. Antoine Beloeuvre
    Antoine Beloeuvre avatar
    5 posts
    Registered:
    31 Jul 2008
    05 Aug 2008
    Link to this post
    Hi,

    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.

    Best regards,

    Antoine.

  2. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    05 Aug 2008
    Link to this post
    i too would be interested to know this

    and in particular how the proposed approach effects SEO for each domain name
  3. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    08 Aug 2008
    Link to this post
    Hello Antoine Quade,

    Currently this cannot be achieved out of the box. You are right that this feature would be really useful, this is why we added it as a Feature Request, and we will try to provide it as soon as possible.

    As a mark of gratitude we updated your Telerik account.

    Kind regards,
    Nikifor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
3 posts, 0 answered