• Resolved eissert

    (@eissert)


    Hello,

    We want to change our cache plugin for Litespeed but we are using Polylang plugin on our website and we’ve seen that the browser default language detection is not working. This functionality is essential for our activity. I know that someone has already posted about this but I don’t know if it is solved or if we can work around this problem.

    Thanks for your help.
    Regards

    • This topic was modified 4 years, 3 months ago by eissert.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support qtwrk

    (@qtwrk)

    add this code at top of your .htaccess

    
    RewriteCond %{HTTP:Accept-Language} en [NC]
    RewriteRule .* - [E=Cache-Vary:%{ENV:LSCACHE_VARY_VALUE}+english]
    
    RewriteCond %{HTTP:Accept-Language} es [NC]
    RewriteRule .* - [E=Cache-Vary:%{ENV:LSCACHE_VARY_VALUE}+spainish]
    

    and purge all cache.

    you can further customize to your needed languages like that.

    Dear @qtwrk

    Thanks for your feedback. So if we got it well, we should add the following code to our htaccess?

    RewriteCond %{HTTP:Accept-Language} en [NC]
    RewriteRule .* - [E=Cache-Vary:%{ENV:LSCACHE_VARY_VALUE}+english]
    
    RewriteCond %{HTTP:Accept-Language} fr [NC]
    RewriteRule .* - [E=Cache-Vary:%{ENV:LSCACHE_VARY_VALUE}+french]
    
    RewriteCond %{HTTP:Accept-Language} de [NC]
    RewriteRule .* - [E=Cache-Vary:%{ENV:LSCACHE_VARY_VALUE}+german]

    Polylang configuration

    • Our default language is English
    • Secondary languages are French (homepage > /fr/accueil/) and German (homepage > /de/home/)
    • Languages Full Names are: English, French, Deutsch
    • Locales: en_US, fr_FR, de_DE
    • Codes: en, fr, de

    Thank you in advance for your help. We just want to make sure this is right before re-installing and setting up LiteSpeed.

    Best Regards

    Plugin Support qtwrk

    (@qtwrk)

    yes , the rule looks alright to me

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Polyland and Litespeed’ is closed to new replies.