I have a website with Domain Access, Domain Locale and the default language is Spanish, second language is English. The detection is done by suffix ( www.example.com/es , www.example.com/en ) and the browser detection is second one. It works perfectly, in internet browsers with spanish as default language, when typping www.example.com , I will access the Spanish version. When the primary language of the browser is English, I will access the english version.

The problem arises when activating cache for anonymous users in Performance section of Admin.

I clear browser cache, and when typping www.example.com, I will be redirected to english version, with the suffix /en added to the url.

When switching off the cache, it works as expected.

I tried to replicate with a fresh Drupal installation, and cannot achieve it, so the problem is persistent only to my installation.

  • 1
    Try multiple browsers when testing (firefox, chrome, etc...). Also see if any of the modules requires some extra code in settings.php or if you have added any extra code in there since you can't reproduce this with a fresh install. – mikeytown2 Dec 9 '16 at 3:19
  • The behaviour is consistent accross browsers. The only different code is that the suffix is forced via PHP code. I have encountered this before: sometimes in a fresh install I can get the browser accepting "/" for English and not "/en" in spite of defining "en" as the English suffix. Removing the force does solve the problem, but it does not work as expected, I want "/" to never be reached, just the "/[LANGUAGE]" tokens. – Cesar Dec 9 '16 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.