Apache mod_rewrite accept language subdomain redirection

后端 未结 2 1205
野的像风
野的像风 2021-01-23 05:56

i have a multilingual site with 3 languages and i\'m using the following rules to redirect requests to the right version of the website based in browser accept language.

2条回答
  •  暖寄归人
    2021-01-23 06:31

    $1 should do the trick.

    RewriteCond %{HTTP:Accept-Language} ^no.*$ [NC]
    RewriteCond %{REQUEST_URI} ^/$ [NC]
    RewriteCond %{QUERY_STRING} !(^q\=) [NC]
    RewriteRule ^(.*)$ /nb/$1 [L,R=301]
    

提交回复
热议问题