1 users online. Create an account or sign in to join them.Users
[tip] rederect on browser language using htaccess
This is an open discussion with 1 reply, filed under General.
1 users online. Create an account or sign in to join them.Users
This is an open discussion with 1 reply, filed under General.
Symphony • Open Source XSLT CMS
--with-xsl)
Hi!
In the past I’ve used php to redirect visitors based on their browser language. Still new to symphony I don’t know how to use my php scripts with it and looked for another solution.
Here I’ve found a solution using htaccess I just wanted to share.
#The 'Accept-Language' header starts with 'de' #and the test is case-insensitive ([NC]) RewriteCond %{HTTP:Accept-Language} ^de [NC] #Redirect user to /de/hauptseite address #sending 301 (Moved Permanently) HTTP status code RewriteRule ^$ /de/hauptseite [L,R=301] RewriteCond %{HTTP:Accept-Language} ^es [NC] RewriteRule ^$ /es/pagina-primera [L,R=301] #For every other language (including English :)) use English RewriteRule ^$ /en/main-page [L,R=301]