15/02/10 Suppose you have several variants of a resource, e.g.: - MIME type: the same image as image/jpg & image/gif - Encoding: the same page compressed and not - Charset: the same page in UTF-8 & in ISO-8859-1 - Language: the same page in English, French, ... We could leave it to the user to choose the right URL Or we could use Content Negotiation This uses certain HTTP request headers: - Accept: - Accept-Encoding: - Accept-Charset: - Accept-Language: They allow the client to express preferences In these headers, order is not significant Preferences are indicated by quality factors, e.g. q=1.0 (default), q=0.5 Configuring the server for content negotiation - two ways: MultiViews or Type Maps - we look at Type Maps Modules: mod_negotiation (and mod_mime) To httpd./conf, insert: AddHandler type-map .var Then create a type map, which is a file whose extension is usually .var In this file, put one record per variant of the resource, e.g. URI: welcome.en.html Content-Type: text/html;qs=1.0 Content-Language: en Description: "English original" URI: welcome.fr.html Content-Type: text/html;qs=0.5 Content-Language: fr Description: "French translation" Apache's negotiation algorithm will then decide which version to send to the client by matching client preferences with server versions. The client now has to request, e.g. welcome.html.var But we can tidy this up by using an Alias Multilingual error messages can be done in this way.