Some multi language plugins like Polylang or WPML can redirect the visitor to the  homepage in the language according to his browser preferences. Unfortunately these plugins usually are using PHP for this redirection, which won’t work when the page is cached.

For this we provide some redirection examples what you can use to redirect visitors even if page is cached.


If you are using webserver which supports htaccess you can add the following code to General » Tweaks » Extra htaccess

RewriteEngine On
RewriteCond %{HTTP:Accept-Language} ^it [NC]
RewriteRule ^$ https://%{HTTP_HOST}/it/ [L,R=302]

RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^$ https://%{HTTP_HOST}/de/ [L,R=302]


If you are using Nginx, you will need to add the following rules to Nginx config:

map $http_accept_language $redirect_lang {

location ~ ^/$ {
	return 302 $redirect_lang;