The mod_negotiation Apache Module
The Apache Web Server has the ability to look at the language preference
specified by a web browser client (such as Netscape Navigator or Microsoft Internet Explorer)
and return the content of different files
depending on that preference. This ability, termed
is a simple yet very powerful Apache feature.
Connect to your Virtual Server via
Telnet or SSH and
add the following line to the top of your web server configuration file (~/www/conf/httpd.conf)
to dynamically load the mod_negotiation Apache Module.
LoadModule negotiation_module modules/mod_negotiation.so
Make the following additions and modifications to your Virtual Server
web server configuration file (~/www/conf/httpd.conf).
Add language directive using the
directive, like this:
AddLanguage en .en
AddLanguage es .es
AddLanguage fr .fr
AddLanguage de .de
AddLanguage it .it
AddLanguage jp .jp
AddLanguage directive associates file extensions
(.en .es .fr .de .it .jp) with corresponding language abbreviations
en es fr de it jp). The abbreviations are predefined and can be
located in any of the latest generation web browser clients.
Add a language priority directive using the
directive, like this:
LanguagePriority en es fr de
LanguagePriority directive allows you to give precedence to some
languages in case of a "tie" during content negotiation or if the
browser client does not specify a language priority (older web browsers).
Just list the languages in decreasing order of preference.
MultiViews option to the
that is part of your
<Directory /usr/local/etc/httpd/htdocs> definition.
For example, your web server configuration file probably is set up
this way currently:
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you (or at least, not yet).
Options Indexes FollowSymLinks
MultiViews option like this:
Options Indexes FollowSymLinks MultiViews
MultiViews option can also be added to the
in .htaccess files.
Serving Language-Specific Content
That's it! Create and upload language-specific content to your
Virtual Server using the appropriate extensions. For example,
create index.html.en, index.html.es, and index.html.fr files in addition to
an index.html file. When a web browser client requests index.html, the web server
will analyze the language preference of the web browser client and serve
the appropriate index.html.* file seamlessly and transparently.
If the language preference submitted by the web
browser does not match any of the type definitions configured in your web server
and documents you have authored, then
the web 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-encoding headers sent to the web server by the web browser client).
For example, if a client will only accept Greek content (el) and
nothing else, and you have only authored content in English, Spanish,
and German, then the web browser client will report a "406" error. It may be wise to
capture "406" errors with a custom
See the following.
Site Map | Contact Us!
Copyright © 1998-2001 Bright Builders, Inc. All rights reserved.
Last Modified: Mon Mar 26 23:23:53 2001 GMT
Page Built: Mon Jul 2 19:57:28 2001 GMT