我正在尝试将访问www.server.com的用户重定向到浏览器的首选语言设置.
当用户在www.server.com/<lang>下面的情况下输入/ es为西班牙语时,它们被正确地代理到智能翻译服务器.但是,当用户在其浏览器中设置了语言首选项时,他们会遇到重定向循环.
我有以下配置:
<VirtualHost *:8008>
ServerName www.server.com
ServerAlias www
ProxyPreserveHost On
RewriteEngine On
RewriteCond %{HTTP:Accept-Language} ^es [NC]
RewriteRule ^/$ es/ [R=301,L]
<Proxy http://server.sl.smartling.com/*>
Allow from all
</Proxy>
<LocationMatch "/es">
ProxyPass http://server.sl.smartling.com/es
ProxyPassReverse http://server.sl.smartling.com/es
Header add Host "www.server.com"
RequestHeader set Host "www.server.com"
</LocationMatch>
DocumentRoot /www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order …Run Code Online (Sandbox Code Playgroud)