[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

country codes and content negotiation

I'm getting sick of answering mail from people whose machines were configured
incorrectly to use a country code, e.g. en-us, so I looked into getting
apache to handle this case the way we'd like. That is, to serve the .en
file when en, en-us, en-gb or en-uk is requested.

Here's an excerpt from the apache docs:
   If multiple language assignments are made for the same extension, the
   last one encountered is the one that is used. That is, for the case
    AddLanguage en .en
    AddLanguage en-uk .en
    AddLanguage en-us .en
   documents with the extension ".en" would be treated as being "en-us".


This must be something that others have encountered. Is there a way of
solving this that avoids us creating symlinks for each variation?
The only method I can think of is to symlink each variation back to the
.en one.  Thus a page on the web site would have 4 files before any
translations are added. E.g.,

contact.en-us.html -> contact.en.html
contact.en-uk.html -> contact.en.html
contact.html -> contact.en.html         (this is needed, as it is the default
                                         when content negotiation fails)

Any other ideas?

James (Jay) Treacy

Reply to: