Multi-Lingual Site Configuration with Apache

Most browsers send the prefered language to servers when they access sites. This can be used to select the appropriate content, using Apache’s mod_negotiation.

Sample .htaccess file

Options +MultiViews
LanguagePriority fr en
AddLanguage en .en
AddLanguage fr .fr

Files

$ more req*
::::::::::::::
request.html.en
::::::::::::::
Hello
::::::::::::::
request.html.fr
::::::::::::::
Bon Jour

If no preference is given, the page will display Bon Jour, otherwise, English readers will get Hello, and French will receive Bon Jour.