Language Domains in Silverstripe CMS
“One language sets you in a corridor for life. Two languages open every door along the way.”
Silverstripe CMS is a flexible and editor-friendly MVC framework for PHP. Silverstripe CMS in combination with Fluent offers intuitive management of content in multiple languages that can be viewed on different domains.
This article will cover the process of extending a Silverstripe CMS website with a single language (or multiple languages with different url segments, website.com/sv etc.) to a website with multiple languages on different domains. To build your own website using Silverstripe CMS, please see Lessons.
- Install Fluent in the project using Composer.
composer require tractorcow/silverstripe-fluent ^4
- Set up DNS-records with the desired domain names and point them to the server, for example, (A)-record for kreationsbyran.se to 182.x.x.x. DNS-records can be set up using Cloudflare or the hosting provider.
- Run /dev/build and log in to the CMS admin panel.
- Click on the new Locales icon and select the Domains tab.
- Add a domain and enter hostname, for example, kreationsbyran.se. Do not include a trailing slash, https://, www etc. Repeat for all desired domains.
- Click on the Locales tab, add a Locale and assign it a domain. Leave the URL Segment as default or make sure that it is unique. Repeat for all desired locales.
A single domain can have multiple locales with different URL segments and language specific content can be achieved by only publishing pages in certain locales.
For more information about managing multilingual content in Silverstrip CMS and Fluent, please see Fluent documentation.