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]
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.