home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 May / Gamestar_62_2004-05_dvd.iso / Programy / apache_2.0.48-win32-x86-no_ssl.msi / Data.Cab / F252553_mod_negotiation.html.en < prev    next >
Extensible Markup Language  |  2003-05-29  |  17KB  |  300 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
  4.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5.               This file is generated from xml source: DO NOT EDIT
  6.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7.       -->
  8. <title>mod_negotiation - Apache HTTP Server</title>
  9. <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
  10. <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
  11. <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
  12. <link href="../images/favicon.ico" rel="shortcut icon" /></head>
  13. <body>
  14. <div id="page-header">
  15. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
  16. <p class="apache">Apache HTTP Server Version 2.0</p>
  17. <img alt="" src="../images/feather.gif" /></div>
  18. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  19. <div id="path">
  20. <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">Modules</a></div>
  21. <div id="page-content">
  22. <div id="preamble"><h1>Apache Module mod_negotiation</h1>
  23. <div class="toplang">
  24. <p><span>Available Languages: </span><a href="../en/mod/mod_negotiation.html" title="English"> en </a> |
  25. <a href="../ja/mod/mod_negotiation.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
  26. </div>
  27. <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides for <a href="../content-negotiation.html">content negotiation</a></td></tr>
  28. <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
  29. <tr><th><a href="module-dict.html#ModuleIdentifier">ModuleáIdentifier:</a></th><td>negotiation_module</td></tr>
  30. <tr><th><a href="module-dict.html#SourceFile">SourceáFile:</a></th><td>mod_negotiation.c</td></tr></table>
  31. <h3>Summary</h3>
  32.  
  33.     <p>Content negotiation, or more accurately content selection, is
  34.     the selection of the document that best matches the clients
  35.     capabilities, from one of several available documents. There
  36.     are two implementations of this.</p>
  37.  
  38.     <ul>
  39.       <li>A type map (a file with the handler
  40.       <code>type-map</code>) which explicitly lists the files
  41.       containing the variants.</li>
  42.  
  43.       <li>A MultiViews search (enabled by the <code>MultiViews</code>
  44.       <code class="directive"><a href="../mod/core.html#options">Options</a></code>), where the server does
  45.       an implicit filename pattern match, and choose from amongst the
  46.       results.</li>
  47.     </ul>
  48. </div>
  49. <div id="quickview"><h3 class="directives">Directives</h3>
  50. <ul id="toc">
  51. <li><img alt="" src="../images/down.gif" /> <a href="#cachenegotiateddocs">CacheNegotiatedDocs</a></li>
  52. <li><img alt="" src="../images/down.gif" /> <a href="#forcelanguagepriority">ForceLanguagePriority</a></li>
  53. <li><img alt="" src="../images/down.gif" /> <a href="#languagepriority">LanguagePriority</a></li>
  54. </ul>
  55. <h3>Topics</h3>
  56. <ul id="topics">
  57. <li><img alt="" src="../images/down.gif" /> <a href="#typemaps">Type maps</a></li>
  58. <li><img alt="" src="../images/down.gif" /> <a href="#multiviews">MultiViews</a></li>
  59. </ul><h3>See also</h3>
  60. <ul class="seealso">
  61. <li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li>
  62. <li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li>
  63. <li><a href="../content-negotiation.html">Content
  64. Negotiation</a></li>
  65. </ul></div>
  66. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  67. <div class="section">
  68. <h2><a name="typemaps" id="typemaps">Type maps</a></h2>
  69.     <p>A type map has a format similar to RFC822 mail headers. It
  70.     contains document descriptions separated by blank lines, with
  71.     lines beginning with a hash character ('#') treated as
  72.     comments. A document description consists of several header
  73.     records; records may be continued on multiple lines if the
  74.     continuation lines start with spaces. The leading space will be
  75.     deleted and the lines concatenated. A header record consists of
  76.     a keyword name, which always ends in a colon, followed by a
  77.     value. Whitespace is allowed between the header name and value,
  78.     and between the tokens of value. The headers allowed are: </p>
  79.  
  80.     <dl>
  81.       <dt><code>Content-Encoding:</code></dt>
  82.       <dd>The encoding of the file. Apache only recognizes
  83.       encodings that are defined by an <code class="directive"><a href="../mod/mod_mime.html#addencoding">AddEncoding</a></code> directive.
  84.       This normally includes the encodings <code>x-compress</code>
  85.       for compress'd files, and <code>x-gzip</code> for gzip'd
  86.       files. The <code>x-</code> prefix is ignored for encoding
  87.       comparisons.</dd>
  88.  
  89.       <dt><code>Content-Language:</code></dt>
  90.       <dd>The language(s) of the variant, as an Internet standard
  91.       language tag (<a href="http://www.ietf.org/rfc/rfc1766.txt">RFC 1766</a>). An example is <code>en</code>,
  92.       meaning English. If the variant contains more than one
  93.       language, they are separated by a comma.</dd>
  94.  
  95.       <dt><code>Content-Length:</code></dt>
  96.       <dd>The length of the file, in bytes. If this header is not
  97.       present, then the actual length of the file is used.</dd>
  98.  
  99.       <dt><code>Content-Type:</code></dt>
  100.  
  101.       <dd>
  102.         The MIME media type of the document, with optional
  103.         parameters. Parameters are separated from the media type
  104.         and from one another by a semi-colon, with a syntax of
  105.         <code>name=value</code>. Common parameters include: 
  106.  
  107.         <dl>
  108.           <dt><code>level</code></dt>
  109.           <dd>an integer specifying the version of the media type.
  110.           For <code>text/html</code> this defaults to 2, otherwise
  111.           0.</dd>
  112.  
  113.           <dt><code>qs</code></dt>
  114.           <dd>a floating-point number with a value in the range 0.0
  115.           to 1.0, indicating the relative 'quality' of this variant
  116.           compared to the other available variants, independent of
  117.           the client's capabilities. For example, a jpeg file is
  118.           usually of higher source quality than an ascii file if it
  119.           is attempting to represent a photograph. However, if the
  120.           resource being represented is ascii art, then an ascii
  121.           file would have a higher source quality than a jpeg file.
  122.           All <code>qs</code> values are therefore specific to a given
  123.           resource.</dd>
  124.         </dl>
  125.  
  126.         <div class="example"><h3>Example</h3><p><code>
  127.           Content-Type: image/jpeg; qs=0.8
  128.         </code></p></div>
  129.       </dd>
  130.  
  131.       <dt><code>URI:</code></dt>
  132.       <dd>uri of the file containing the variant (of the given
  133.       media type, encoded with the given content encoding). These
  134.       are interpreted as URLs relative to the map file; they must
  135.       be on the same server (!), and they must refer to files to
  136.       which the client would be granted access if they were to be
  137.       requested directly.</dd>
  138.  
  139.       <dt><code>Body:</code></dt>
  140.       <dd>New in Apache 2.0, the actual content of the resource may
  141.       be included in the type-map file using the Body header.  This
  142.       header must contain a string that designates a delimiter for
  143.       the body content. Then all following lines in the type map
  144.       file will be considered part of the resource body until the
  145.       delimiter string is found.
  146.  
  147.       <div class="example"><h3>Example:</h3><p><code>
  148.         Body:----xyz----<br />
  149.         <html><br />
  150.         <body><br />
  151.         <p>Content of the page.</p><br />
  152.         </body><br />
  153.         </html><br />
  154.         ----xyz----
  155.       </code></p></div>
  156.       </dd>
  157.     </dl>
  158. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  159. <div class="section">
  160. <h2><a name="multiviews" id="multiviews">MultiViews</a></h2>
  161.     <p>A MultiViews search is enabled by the <code>MultiViews</code>
  162.     <code class="directive"><a href="../mod/core.html#options">Options</a></code>. If the server receives a
  163.     request for <code>/some/dir/foo</code> and
  164.     <code>/some/dir/foo</code> does <em>not</em> exist, then the
  165.     server reads the directory looking for all files named
  166.     <code>foo.*</code>, and effectively fakes up a type map which
  167.     names all those files, assigning them the same media types and
  168.     content-encodings it would have if the client had asked for one
  169.     of them by name. It then chooses the best match to the client's
  170.     requirements, and returns that document.</p>
  171. </div>
  172. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  173. <div class="directive-section"><h2><a name="CacheNegotiatedDocs" id="CacheNegotiatedDocs">CacheNegotiatedDocs</a> <a name="cachenegotiateddocs" id="cachenegotiateddocs">Directive</a></h2>
  174. <table class="directive">
  175. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Allows content-negotiated documents to be 
  176. cached by proxy servers</td></tr>
  177. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheNegotiatedDocs On|Off</code></td></tr>
  178. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheNegotiatedDocs Off</code></td></tr>
  179. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  180. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
  181. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_negotiation</td></tr>
  182. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The syntax changed in version 2.0.</td></tr>
  183. </table>
  184.     <p>If set, this directive allows content-negotiated documents
  185.     to be cached by proxy servers. This could mean that clients
  186.     behind those proxys could retrieve versions of the documents
  187.     that are not the best match for their abilities, but it will
  188.     make caching more efficient.</p>
  189.  
  190.     <p>This directive only applies to requests which come from
  191.     HTTP/1.0 browsers. HTTP/1.1 provides much better control over
  192.     the caching of negotiated documents, and this directive has no
  193.     effect in responses to HTTP/1.1 requests.</p>
  194.  
  195.     <p>Prior to version 2.0,
  196.     <code class="directive">CacheNegotiatedDocs</code> did not take an
  197.     argument; it was turned on by the presence of the directive by
  198.     itself.</p>
  199.  
  200. </div>
  201. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  202. <div class="directive-section"><h2><a name="ForceLanguagePriority" id="ForceLanguagePriority">ForceLanguagePriority</a> <a name="forcelanguagepriority" id="forcelanguagepriority">Directive</a></h2>
  203. <table class="directive">
  204. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Action to take if a single acceptable document is not 
  205. found</td></tr>
  206. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceLanguagePriority None|Prefer|Fallback [Prefer|Fallback]</code></td></tr>
  207. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ForceLanguagePriority Prefer</code></td></tr>
  208. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  209. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  210. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
  211. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_negotiation</td></tr>
  212. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later</td></tr>
  213. </table>
  214.     <p>The <code class="directive">ForceLanguagePriority</code> directive uses
  215.     the given <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> to satisfy
  216.     negotation where the server could otherwise not return a single
  217.     matching document.</p>
  218.  
  219.     <p><code>ForceLanguagePriority Prefer</code> uses
  220.     <code>LanguagePriority</code> to serve a one valid result, rather
  221.     than returning an HTTP result 300 (MULTIPLE CHOICES) when there
  222.     are several equally valid choices.  If the directives below were
  223.     given, and the user's <code>Accept-Language</code> header assigned
  224.     <code>en</code> and <code>de</code> each as quality <code>.500</code>
  225.     (equally acceptable) then the first matching variant, <code>en</code>,
  226.     will be served.</p>
  227.  
  228.     <div class="example"><p><code>
  229.       LanguagePriority en fr de<br />
  230.       ForceLanguagePriority Prefer
  231.     </code></p></div>
  232.  
  233.     <p><code>ForceLanguagePriority Fallback</code> uses
  234.     <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> to
  235.     serve a valid result, rather than returning an HTTP result 406
  236.     (NOT ACCEPTABLE). If the directives below were given, and the user's
  237.     <code>Accept-Language</code> only permitted an <code>es</code>
  238.     language response, but such a variant isn't found, then the first
  239.     variant from the <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> list below will be served.</p>
  240.  
  241.     <div class="example"><p><code>
  242.       LanguagePriority en fr de<br />
  243.       ForceLanguagePriority Fallback
  244.     </code></p></div>
  245.  
  246.     <p>Both options, <code>Prefer</code> and <code>Fallback</code>, may be
  247.     specified, so either the first matching variant from <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> will be served if
  248.     more than one variant is acceptable, or first available document will
  249.     be served if none of the variants matched the client's acceptable list
  250.     of languages.</p>
  251.  
  252. <h3>See also</h3>
  253. <ul>
  254. <li><code class="directive"><a href="../mod/mod_mime.html#addlanguage">AddLanguage</a></code></li>
  255. </ul>
  256. </div>
  257. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  258. <div class="directive-section"><h2><a name="LanguagePriority" id="LanguagePriority">LanguagePriority</a> <a name="languagepriority" id="languagepriority">Directive</a></h2>
  259. <table class="directive">
  260. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The precendence of language variants for cases where
  261. the client does not express a preference</td></tr>
  262. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LanguagePriority <var>MIME-lang</var> [<var>MIME-lang</var>]
  263. ...</code></td></tr>
  264. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  265. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  266. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
  267. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_negotiation</td></tr>
  268. </table>
  269.     <p>The <code class="directive">LanguagePriority</code> sets the precedence
  270.     of language variants for the case where the client does not
  271.     express a preference, when handling a MultiViews request. The list
  272.     of <var>MIME-lang</var> are in order of decreasing preference.</p>
  273.  
  274.     <div class="example"><h3>Example:</h3><p><code>
  275.       LanguagePriority en fr de
  276.     </code></p></div>
  277.  
  278.     <p>For a request for <code>foo.html</code>, where
  279.     <code>foo.html.fr</code> and <code>foo.html.de</code> both
  280.     existed, but the browser did not express a language preference,
  281.     then <code>foo.html.fr</code> would be returned.</p>
  282.  
  283.     <p>Note that this directive only has an effect if a 'best'
  284.     language cannot be determined by any other means or the <code class="directive"><a href="#forcelanguagepriority">ForceLanguagePriority</a></code> directive
  285.     is not <code>None</code>. Correctly implemented HTTP/1.1 requests
  286.     will mean this directive has no effect.</p>
  287.  
  288. <h3>See also</h3>
  289. <ul>
  290. <li><code class="directive"><a href="../mod/mod_mime.html#addlanguage">AddLanguage</a></code></li>
  291. </ul>
  292. </div>
  293. </div>
  294. <div class="bottomlang">
  295. <p><span>Available Languages: </span><a href="../en/mod/mod_negotiation.html" title="English"> en </a> |
  296. <a href="../ja/mod/mod_negotiation.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
  297. </div><div id="footer">
  298. <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
  299. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
  300. </body></html>