# Define the correct MIME type for specific languages
AddType text/html .bn
AddType text/html .el
AddType text/html .nb
AddType text/html .pl
AddType text/html .es
AddType text/html .tr
AddType text/html .sr
AddType text/html .si
AddType text/html .pt
 
AddLanguage ar .ar
AddLanguage bn-in .bn_IN
AddLanguage ca .ca
AddLanguage cs .cs
AddLanguage da .da
AddLanguage de .de
AddLanguage en .en
AddLanguage es .es
AddLanguage fi .fi
AddLanguage fr .fr
AddLanguage hu .hu
AddLanguage id .id
AddLanguage it .it
AddLanguage ja .ja
AddLanguage km .km
AddLanguage ko .ko
AddLanguage pl .pl
AddLanguage pt .pt
AddLanguage pt-br .pt_BR
AddLanguage ru .ru
AddLanguage si .si
AddLanguage sk .sk
AddLanguage sr .sr
AddLanguage sv .sv
AddLanguage tr .tr
AddLanguage uk .uk
AddLanguage zh-cn .zh_Hans_CN

LanguagePriority en
ForceLanguagePriority Prefer Fallback

AddDefaultCharset utf-8

RewriteEngine on

RewriteCond %{QUERY_STRING} ^lang=(ar|bn_IN|ca|cs|da|de|en|es|fi|fr|hu|id|it|ja|km|ko|pl|pt|pt_BR|ru|si|sk|sr|sv|tr|uk|zh_Hans_CN)$
RewriteRule ^(?:/(?:ar|bn_IN|ca|cs|da|de|en|es|fi|fr|hu|id|it|ja|km|ko|pl|pt|pt_BR|ru|si|sk|sr|sv|tr|uk|zh_Hans_CN))?(/.*)$ /%1$1? [R=301]
AliasMatch ^(?:/(?:ar|bn_IN|ca|cs|da|de|en|es|fi|fr|hu|id|it|ja|km|ko|pl|pt|pt_BR|ru|si|sk|sr|sv|tr|uk|zh_Hans_CN))(/.*)?$ /srv/web/arm.fedoraproject.org$1

<Directory /srv/web/arm.fedoraproject.org>
  Options MultiViews

  SetEnvIf Request_URI ^/ar/ prefer-language=ar
  SetEnvIf Request_URI ^/bn_IN/ prefer-language=bn-in
  SetEnvIf Request_URI ^/ca/ prefer-language=ca
  SetEnvIf Request_URI ^/cs/ prefer-language=cs
  SetEnvIf Request_URI ^/da/ prefer-language=da
  SetEnvIf Request_URI ^/de/ prefer-language=de
  SetEnvIf Request_URI ^/en/ prefer-language=en
  SetEnvIf Request_URI ^/es/ prefer-language=es
  SetEnvIf Request_URI ^/fi/ prefer-language=fi
  SetEnvIf Request_URI ^/fr/ prefer-language=fr
  SetEnvIf Request_URI ^/hu/ prefer-language=hu
  SetEnvIf Request_URI ^/id/ prefer-language=id
  SetEnvIf Request_URI ^/it/ prefer-language=it
  SetEnvIf Request_URI ^/ja/ prefer-language=ja
  SetEnvIf Request_URI ^/km/ prefer-language=km
  SetEnvIf Request_URI ^/ko/ prefer-language=ko
  SetEnvIf Request_URI ^/pl/ prefer-language=pl
  SetEnvIf Request_URI ^/pt/ prefer-language=pt
  SetEnvIf Request_URI ^/pt_BR/ prefer-language=pt-br
  SetEnvIf Request_URI ^/ru/ prefer-language=ru
  SetEnvIf Request_URI ^/si/ prefer-language=si
  SetEnvIf Request_URI ^/sk/ prefer-language=sk
  SetEnvIf Request_URI ^/sr/ prefer-language=sr
  SetEnvIf Request_URI ^/sv/ prefer-language=sv
  SetEnvIf Request_URI ^/tr/ prefer-language=tr
  SetEnvIf Request_URI ^/uk/ prefer-language=uk
  SetEnvIf Request_URI ^/zh_Hans_CN/ prefer-language=zh-cn
</Directory>
