httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbo...@apache.org
Subject svn commit: r1089714 - /httpd/httpd/trunk/docs/manual/mod/mod_negotiation.xml
Date Thu, 07 Apr 2011 03:10:58 GMT
Author: rbowen
Date: Thu Apr  7 03:10:58 2011
New Revision: 1089714

URL: http://svn.apache.org/viewvc?rev=1089714&view=rev
Log:
Adds an example of how one might actually construct a type-map file.

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_negotiation.xml

Modified: httpd/httpd/trunk/docs/manual/mod/mod_negotiation.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_negotiation.xml?rev=1089714&r1=1089713&r2=1089714&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_negotiation.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_negotiation.xml Thu Apr  7 03:10:58 2011
@@ -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>



Mime
View raw message