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

Forums / Developing with Sitefinity / Localization with sub-domains using custom UrlMapping code

Localization with sub-domains using custom UrlMapping code

5 posts, 0 answered
  1. Jason Hedges
    Jason Hedges avatar
    22 posts
    Registered:
    16 Jul 2009
    27 Jul 2010
    Link to this post
    I'm trying to setup my set to use sub-domains for localized content where www.site.com will be our English site and es.site.com will be our spanish site. I setup the site to use PagePrefix for localization and I'm trying to get es.site.com to redirect to /es for spanish content.

    I've read through http://www.sitefinity.com/devnet/forums/sitefinity-3-x/set-up-installation/localization-issue.aspx and http://www.sitefinity.com/devnet/kb/sitefinity-3-x/creating-a-custom-url-mapping-service.aspx.

    It looks like I would have to create a custom URL mapping service to do this. Is that correct? I'm having trouble getting my custom URL mapping service to work correctly. Can you give me an example of how that might work?

    Thanks!
    Jason
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Jul 2010
    Link to this post
    Hello Jason Hedges,

    You could try using persistenceMode="DomainName"

    <localization defaultProvider="Sitefinity" persistenceMode="DomainName" defaultCulture="en" cultures="en, es" >
      <providers>
        <clear />
        <add name="Sitefinity" type="Telerik.Localization.Data.DefaultProvider, Telerik.Localization.Data" connectionStringName="DefaultConnection" />
      </providers>
      <cultureMappings>
         
        <add key="www.domain.com" culture="en" />
        <add key="es.domain.com" culture="es" />
      </cultureMappings>
    </localization>


    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Jason Hedges
    Jason Hedges avatar
    22 posts
    Registered:
    16 Jul 2009
    27 Jul 2010
    Link to this post
    Thanks for the reply Ivan. I think I was under the impression that you could not use sub-domains with persistenceMode="DomainName".

    Thanks,
    Jason
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Jul 2010
    Link to this post
    Hi Jason Hedges,

    The domain name persistence mode can be used, however it will not work if you wish to use it for domain suffix - e.g. domain.es. It will however work with prefixing.

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Jason Hedges
    Jason Hedges avatar
    22 posts
    Registered:
    16 Jul 2009
    30 Jul 2010
    Link to this post
    Great, thanks!
Register for webinar
5 posts, 0 answered