So i searched the whole day yesterday for a solution to my problem, found similarities but nothing matching exactly. I try to write a .htacces file which is supposed to check the browser language and then redirect the user either to (GERMAN) xyz.de/?lang=de&page=$1 or (NONGERMAN) xyz.de/?lang=en&page=$1
It's supposed to automatically load the homepage in the browser's language. I got it so far that I don't get 500 errors any more and it works pretty fine with IE and does load the page in the correct language, which impresses me a lot. But in Firefox or Chrome it will show neither language nor the page; if I var_dump($_GET) I get nothing.
.htaccess
RewriteEngine on
RewriteCond %{HTTP_ACCEPT_LANGUAGE} ^(de|de-at|de-li|de-lu|de-ch) [NC]
RewriteRule ^([^./]{3}[^.]*)$ /index.php?lang=de&page=$1 [QSA,L]
RewriteCond %{HTTP_ACCEPT_LANGUAGE} !^(de|de-at|de-li|de-lu|de-ch) [NC]
RewriteRule ^([^./]{3}[^.]*)$ /index.php?lang=en&page=$1 [QSA,L]<i>
[IE9] xyz.de
var_dump($_GET)
array(2) { ["page"]=> string(0) "" ["lang"]=> string(2) "de" }
[GECKO] xyz.de
var_dump($_GET)
array(0) { }
[GECKO] xyz.de/home
var_dump($_GET)
Anybody an idea what the problem is????
array(2) { ["lang"]=> string(2) "en" ["page"]=> string(4) "home" }
// Change
Thanks to the Last Post i changed the Code following:
RewriteCond %{HTTP:ACCEPT_LANGUAGE} !^(de) [NC]
RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1&lang=en [QSA,L]
RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1&lang=de [QSA,L]
now it redirects nothing, just when i put /home oder secondpage or what ever in it, it loads the page always in english and its supposed to redirect the page to xyz.de/lang=[ACCEPT-LANG]&page=home if you press in xyz.de