Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » i18n / translatable: keeping the same url segment for multiple languages

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 647 Views
  • Anatol
    Avatar
    126 Posts

    i18n / translatable: keeping the same url segment for multiple languages Link to this post

    Hi,

    I just updated Silverstripe to the latest version on an approximately 3 years old multilingual site. It seems that now translated pages automatically change the URLSegment to the locale code, e.g. mydomain.com/my-page when translated becomes mydomain.com/my-page-mi-NZ .

    I would much prefer to keep the URLSegment the same as the default language and solve the locale setting with a subdomain such as en.mydomain.com and mi.mydomain.com that then uses a .htaccess rewrite, for example

    RewriteCond %{HTTP_HOST} ^mi\.mydomain\.com
    RewriteRule ^(.*) $1?locale=mi-NZ&%{QUERY_STRING}

    So when I access the page http://mi.mydomain.com/my-page
    it actually opens
    http://mi.mydomain.com/my-page?locale=mi-NZ
    (the subdomain is not really important in the rewritten URL)

    Any hint on how to keep URL segments same as the page in the default language would be highly appreciated.

    Cheers!
    Anatol

    647 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.