Redirect According To The User's Language
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:
For example to set up site with Irish, French and English as the fallback/default:
RewriteEngine onFor a full list of languages, the best I've found is from Perl's I18N-LangTags module.
# Irish UsersRewriteCond %{HTTP:Accept-Language} ^ga [NC]RewriteRule ^$ /ga/ [L,R=301]
# French UsersRewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteRule ^$ /fr/ [L,R=301]
# Default PageRewriteRule ^$ /en/main-page [L,R=301]
