Home Wordpress browser language redirections - too many redirects error
Reply: 0

Wordpress browser language redirections - too many redirects error

user830
1#
user830 Published in June 24, 2018, 11:56 pm

I'm trying to implement a redirection in my Wordpress website based on browser language, by adding this code on the .htaccess

RewriteEngine On
RewriteCond %{HTTP:Accept-Language} ^es [NC]
RewriteRule ^$ https://www.example.com/ambienteTrabajo/?lang=es [L,R=301]

the ?lang=es is how the WPML plugin labels my translated pages, however I'm not using the built in WPML redirection because it gives me an unpleasant delay: the page first loads in English and then a few seconds later redirects to Spanish.

With the code I added before the url redirection is done, but the page is not shown; it shows a blank page with a TOO MANY REDIRECTS message.

How should I set up this redirect rule? I've tried a lot of things without any success.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312695 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO