Niall Donegan: March 2010 Archives

Redirecting according to the language that a user has set is actually fairly easy. The most important thing to remember is to put the most specific first.

For example to set up site with Irish, French and English as the fallback/default:

RewriteEngine on
# Irish Users
RewriteCond %{HTTP:Accept-Language} ^ga [NC]
RewriteRule ^$ /ga/ [L,R=301]
# French Users
RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteRule ^$ /fr/ [L,R=301]
# Default Page
RewriteRule ^$ /en/main-page [L,R=301]
For a full list of languages, the best I've found is from Perl's I18N-LangTags module.

About this Archive

This page is a archive of recent entries written by Niall Donegan in March 2010.

Niall Donegan: October 2007 is the previous archive.

Find recent content on the main index or look in the archives to find all content.

Niall Donegan: Monthly Archives

Powered by Movable Type 4.31-en