Has anyone encountered an issue where multiple instances of the locale get added to the URL when editing a page? I'm suddenly getting pages in the CMS where the URL is shown as


I had to go work on another project, so I will do more debugging next week. But in general if I develop a SilverStripe site with only fluent Locales enabled (no domains), then when the site is finished (all pages translated) and deployed to live, I should be able to just add own domains for locales and everything should work as before except now domains are used instead of locale prefix? (for different locales)

@dorsetdigital I forgot about that, thanks for the tip!


Hello, yes actually I managed to get it working.

I had to override FluentDirectoryExtension.php, because it never changed the locale. so I created my own CustomFluentDirectoryExtension from FluentDirectoryExtension and replaced the following:

  1. protected function getRuleController($existingRule, $localeObj)
  2. {
  3. $controller = isset($existingRule['Controller']) ? $existingRule['Controller'] : $existingRule;
  4. // Decorate Director class to override controllers for a specific locale
  5. $this->owner->extend('updateLocalePageController', $controller, $localeObj);
  6. return $controller;
  7. }
  9. with this
  11. protected function getRuleController($existingRule, &$localeObj)
  12. {
  13. $controller = isset($existingRule['Controller']) ? $existingRule['Controller'] : $existingRule;
  14. // Decorate Director class to override controllers for a specific locale
  15. $this->owner->extend('updateLocalePageController', $controller, $localeObj);
  17. $localeObj = LocaleDomainUtil::getCurrentLocale(); // I determine which locale by looking at the current URL.
  18. $state = FluentState::singleton();
  19. $state->setLocale($localeObj->Locale);
  21. return $controller;
  22. }

I am not working on that project anymore but I hope that code will help you in the right direction. I don't think I needed to add anything else.


You could probably just do it with a ServerAlias directive in the apache config FWIW... no need for multiple hosts


any chance to start xdebug and see what's going on? It should work, I guess it's a config issue. Did you flush? Did you validate your configuration yml? Yml is very picky about whitespace


My site is under development so I don't got any real domains to try with atm, I try to fake the domains locally so I know what to expect when trying to accomplish this live.


  1. <VirtualHost *>
  2. ServerName
  3. DocumentRoot "c:/wamp64/www/project/"
  4. <Directory "c:/wamp64/www/">
  5. Deny from all
  6. Allow from
  7. </Directory>
  8. </VirtualHost>
  10. <VirtualHost *>
  11. ServerName
  12. DocumentRoot "c:/wamp64/www/project/"
  13. <Directory "c:/wamp64/www/">
  14. Deny from all
  15. Allow from
  16. </Directory>
  17. </VirtualHost>

My Windows hosts file:


With this I am able to browse to my project by going to my custom domains.


you can have a dev config with your local domains and a live config for the live domains in one file. Does your local webserver reflect the local domains?


Hello! I am having some problems regarding using domains for different locales in silverstripe-fluent:

  • I have added two domains & locales in the CMS.
  • For each domain I have set different Default locale values
  • I have added SS_FLUENT_FORCE_DOMAIN="true"to my .env file. The language switcher (loop $Locales -> $Link) now correctly links to another domain on the HomePage but the CurrentLocale does not change. Also after switching to domains it breaks all my translated pages, I get [Emergency] Uncaught InvalidArgumentException: Invalid "TractorCow\Fluent\Model\Locale" locale. when trying to view them.

Any idea what I am missing? Everything works as normal if I remove the use of domains and just have different prefixes with the default URL. Also I have setup virtual hosts to create the domains locally, could that affect this?