From: Rich Bowen Date: Thu, 7 Apr 2011 03:10:58 +0000 (+0000) Subject: Adds an example of how one might actually construct a type-map file. X-Git-Tag: 2.3.12~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=259e0db4a6b580580357a580e6991e69c6c9ac87;p=thirdparty%2Fapache%2Fhttpd.git Adds an example of how one might actually construct a type-map file. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1089714 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_negotiation.xml b/docs/manual/mod/mod_negotiation.xml index 8afaff070ce..4bec7943b9f 100644 --- a/docs/manual/mod/mod_negotiation.xml +++ b/docs/manual/mod/mod_negotiation.xml @@ -145,6 +145,46 @@ Negotiation + +

Consider, for example, a resource called + document.html which is available in English, French, + and German. The files for each of these are called + document.html.en, document.html.fr, and + document.html.de, respectively. The type map file will + be called index.html.var, and will contain the + following:

+ + index.html.var + + Content-language: en
+ Content-type: text/html
+ URI: document.html.en
+
+ Content-language: fr
+ Content-type: text/html
+ URI: document.html.fr
+
+ Content-language: de
+ Content-type: text/html
+ URI: document.html.de
+
+ +
+ +

All four of these files should be placed in the same directory, + and the .var file should be associated with the + type-map handler with an AddHandler directive:

+ + + AddHandler type-map .var + + +

A request for document.html in this directory will + result in document.html.var being consulted, and the + variant chosen which most closely matches the language preference + specified in the user's Accept-Language request + header.

Multiviews