Accept-Language is a list of weighted language identifiers. Just the occurrence of a certain language identifier does not mean that it’s the most preferred language. There might be other languages that are more preferred (higher q value) or even not accepted at all (i.e. q=0
).
So instead of just looking for a certain language identifier, parse the list of accepted languages and find the best match of accepted languages and available languages while considering the preference order. And since you seem to be using PHP, do that with PHP instead of mod_rewrite.
Gumbo
2010-09-09 09:39:51