summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod
diff options
context:
space:
mode:
authorRich Bowen <rbowen@apache.org>2011-04-07 05:10:58 +0200
committerRich Bowen <rbowen@apache.org>2011-04-07 05:10:58 +0200
commit259e0db4a6b580580357a580e6991e69c6c9ac87 (patch)
tree9293449c6b3b581418e70ec153ce5c99752444db /docs/manual/mod
parentaxe a couple of unused vars, mark a function as static (diff)
downloadapache2-259e0db4a6b580580357a580e6991e69c6c9ac87.tar.xz
apache2-259e0db4a6b580580357a580e6991e69c6c9ac87.zip
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
Diffstat (limited to 'docs/manual/mod')
-rw-r--r--docs/manual/mod/mod_negotiation.xml40
1 files changed, 40 insertions, 0 deletions
diff --git a/docs/manual/mod/mod_negotiation.xml b/docs/manual/mod/mod_negotiation.xml
index 8afaff070c..4bec7943b9 100644
--- a/docs/manual/mod/mod_negotiation.xml
+++ b/docs/manual/mod/mod_negotiation.xml
@@ -145,6 +145,46 @@ Negotiation</a></seealso>
</example>
</dd>
</dl>
+
+ <p>Consider, for example, a resource called
+ <code>document.html</code> which is available in English, French,
+ and German. The files for each of these are called
+ <code>document.html.en</code>, <code>document.html.fr</code>, and
+ <code>document.html.de</code>, respectively. The type map file will
+ be called <code>index.html.var</code>, and will contain the
+ following:</p>
+
+ <example><title>index.html.var</title>
+
+ Content-language: en<br />
+ Content-type: text/html<br />
+ URI: document.html.en<br />
+ <br />
+ Content-language: fr<br />
+ Content-type: text/html<br />
+ URI: document.html.fr<br />
+ <br />
+ Content-language: de<br />
+ Content-type: text/html<br />
+ URI: document.html.de<br />
+ <br />
+
+ </example>
+
+ <p>All four of these files should be placed in the same directory,
+ and the <code>.var</code> file should be associated with the
+ <code>type-map</code> handler with an <directive
+ module="mod_mime">AddHandler</directive> directive:</p>
+
+ <example>
+ AddHandler type-map .var
+ <example>
+
+ <p>A request for <code>document.html</code> in this directory will
+ result in <code>document.html.var</code> being consulted, and the
+ variant chosen which most closely matches the language preference
+ specified in the user's <code>Accept-Language</code> request
+ header.</p>
</section>
<section id="multiviews"><title>Multiviews</title>