|
htaccess redirect dual language browsers
Hello,
Im trying to redirect all users but swedish ones to the english side of my site but since swedish browsers by default have both english and swedish languages installed tey all get redirected to the english side.
Swedish : xyz.com
English : xyz.com/?lang=en
I´ve been using this code
RewriteEngine on
RewriteCond %{QUERY_STRING} !(&|^)lang=
RewriteCond %{HTTP:Accept-Language} (aa|ab|af|am|ar|as|ay|az|ba|be|bg|bh|bi|bn|bo|br|ca|co|cs|cy|da|de|dz|el|en|eo|es|et|eu|fa|fi|fj|fo| fr|fy|ga|gd|gl|gn|gu|ha|hi|hr|hu|hy|ia|ie|ik|in|is|it|iw|ja|ji|jw|ka|kk|kl|km|kn|ko|ks|ku|ky|la|ln|l o|lt|lv|mg|mi|mk|ml|mn|mo|mr|ms|mt|my|na|ne|nl|no|oc|om|or|pa|pl|ps|pt|qu|rm|rn|ro|ru|rw|sa|sd|sg|sh |si|sk|sl|sm|sn|so|sq|sr|ss|st|su|sw|ta|te|tg|th|ti|tk|tl|tn|to|tr|ts|tt|tw|uk|ur|uz|vi|vo|wo|xh|yo| zh|zu) [NC]
RewriteRule ^(.*)$ http://www.xyz.com/$1?lang=%1 [L]
How can I do this so every browser is redirected to xyz.com/?lang=en but with an exception for swedish that would stay on xyz.com ?
Greatful for any help !
|