I have multilingual site such as www.demo.com and bn.demo.com it works fine at dev and local site. but when i deployed at production it's url language is not working.

When I hit www.demo.com it goes english site. and then when i hit bn.demo.com it should come at bangla site but the strings are not translated.

Surprisingly when I logged in then switch url the translated string works fine. Why it does not works at logged out situation? how can I resolve it?

And my .htaccess files and rewrite condition

# (http://example.com/... will be redirected to http://www.example.com/...)
# uncomment the following:

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^(www|bn)\. [NC]
RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • Is Cache pages for anonymous users enabled on https://example.com/admin/config/development/performance? It might be that the cached pages for anonymous users are not yet aware of the language. A cache clear should solve that. – Neograph734 Jan 11 '17 at 16:03
  • It's enabled and Cleared cache but not solved – Roni Jan 11 '17 at 16:08
  • Then it might be related to load balancers and/or Varnish cache? Without knowing your infrastructure it is hard do tell, but because it works when you are logged in, it is likely cache related. – Neograph734 Jan 11 '17 at 16:09

Just a beginner's suggestion... when you migrate your site, did you turn off clean URLs, clear cache and put into maintenance mode before migrating? If not, I suggest you try that then turn back on clean URLs, and take out of maintenance mode.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.