![]() |
|
|
|
![]() |
![]() ![]() |
Serving Multi-language DocumentsThe Apache Web Server has the ability to look at the language preference specified by a browser client and return the content of different files depending on that preference. This ability, termed "language content negotiation", is a simple yet very powerful feature of the Apache server that is not often used.There are essentially two approaches to content negotiation. The first uses a "variants" file (or a "var" file) which essentially lists document resources file by file and identifies them with a specific language. This may be convenient for small sites or if you only want to provide language typing for an entry page of a web site (which would then explicitly link to web content authored in different languages). The second approach uses file extensions (just like MIME types) to associate a file with a language. Please find below a list of the steps necessary to configure the web services on your Virtual Server to perform language content negotiation by file extension. More information about configuring language content negotiation on a file by file basis can be found by reading the reference documents included at the bottom of this page.
There is at least one snag. If the language preference the browser submits does match any of the type definitions on your server and documents you have authored. The server will return a 406 error (i.e. the resource was found, but could not be delivered because the type of the resource is incompatible with the acceptable types indicated by the accept or accept-encoding headers sent to the server by the client). So, for example, if a client will only accept Greek content (el) and nothing else, but you have only authored content in English, Spanish, and German, the client will receive a 406 error. It may be wise to capture the 406 errors with a custom ErrorDocument script. References |
|
![]() |
[ SERVERS | ECOMMERCE | SUPPORT | SPECIALS | SEARCH | SITE MAP | ORDER] [ HOME | CONTACT US | ABOUT US | PRIVACY | LEGAL | REFUND POLICY ] © Copyright 1998 - 2001 Blue Reef Consulting, Inc. All Rights Reserved. Comments or questions about this web site? Write to webmaster@bluereef.net. Phone: (305) 274-8393 |