Wednesday 22 August 2007 12:14:21 pm
Hello, Sébastien I implemented it so: 1. Update your httpd.conf (or .htaccess)
RewriteCond %{HTTP:Accept-Language} ^ru.* [NC]
RewriteRule (.*) - [E=SITEACCESS:siteaccess_ru]
RewriteCond %{HTTP:Accept-Language} ^en.* [NC]
RewriteRule (.*) - [E=SITEACCESS:siteaccess_en]
"ru" and "en" are languages of my site. It adds appropriate server variable depending of user Accept-Language. 2. Update your settings/override/site.ini.append
MatchOrder=servervar;host
ServerVariableName=SITEACCESS
HostMatchMapItems[]=www.yoursite.com;siteaccess_default
Now users with Accept-Language = ru* see siteaccess_ru siteaccess, users with Accept-Language = en* see siteaccess_en siteaccess, any other users see siteaccess_default. You could also change rewriterules to minimize set of rules and with site.ini settings to create other siteaccess matching.
|