Hi everyone, I'm trying to redirect visitors of my blog to either the french or the english version. So I made this .htaccess :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#---------------------
# Language Redirection
#---------------------
# Checking if the redirection didn't occur yet
# Checking that the url doesn't begin with /en
RewriteCond %{REQUEST_URI} !^/en(.*)$
# Checking if the user is in english
RewriteCond %{HTTP:Accept-Language} ^en [NC]
# Redirecting from /the/url to /en/the/url
RewriteRule ^(.*)$ /en/$1 [L,R=301]
#----------------------
# Wordpress Redirection
#----------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Basically, I would like to redirect my visitors coming from google from /my/article to /en/my/article if they are english. Instead, there is an infinite loop! I think that REQUEST_URI is always index.php because of the the last RewriteRule.
Does anyone ever did this?
Thanks a lot