<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Module mod_xhtml_neg</title> </head> <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000080" alink="#ff0000"> <h1 align="center">Module mod_xhtml_neg</h1> <p>This module is contained in the <code>mod_xhtml_neg.c</code> file. It provides content negotiation facilities for XHTML documents.</p> <h2>Summary</h2> <p>This module provides content negotiation facilities for XHTML documents that conform to Appendix C compatibility requirements of the XHTML 1.0 specification. This allows compatible browsers to view XHTML content as XML-compliant documents, and older or less compatible clients to view XHTML content as text/html documents.</p> <h2>Directives</h2> <ul> <li><a href="#negactive">XhtmlNegActive</a></li> <li><a href="#neglog">XhtmlNegLog</a></li> <li><a href="#negtypes">XhtmlNegTypes</a></li> <li><a href="#starsignore">XhtmlNegStarsIgnore</a></li> <li><a href="#negcache">XhtmlNegCache</a></li> </ul> <hr /> <h2><a id="negactive" name="negactive">XhtmlNegActive</a></h2> <strong>Syntax:</strong> XhtmlNegActive on|off<br /> <strong>Context:</strong> server config, virtual host, directory, .htaccess<br /> <strong>Status:</strong> Extension<br /> <strong>Module:</strong> mod_xhtml_neg<br /> <strong>Compatibility:</strong> Apache 1.3 and above <p>This directive enables or disables content negotiation for the document realm in question. (That is, if found in an <code>.htaccess</code> file, for instance, it applies only to documents generated from that directory.) If set to <em><code>Off</code></em>, no negotiation will be performed for any document in the realm (unless overridden at a lower level, such as an <code>.htaccess</code> file overriding a server config file). If set to <em><code>On</code></em>, the header will be added to served documents according to the criteria defined by the <a href="#negtypes">XhtmlNegTypes</a> and <a href="#starsignore">XhtmlNegStarsIgnore</a> directives.</p> <p>Note that this directive does not guarantee that content negotiation will be performed. If the criteria aren't met, no negotiation will be performed, and the effect will be as though this directive wasn't even specified.</p> <h2><a id="neglog" name="neglog">XhtmlNegLog</a></h2> <strong>Syntax:</strong> XhtmlNegLog <em>/path/to/log/file</em><br /> <strong>Context:</strong> server config<br /> <strong>Status:</strong> Extension<br /> <strong>Module:</strong> mod_xhtml_neg<br /> <strong>Compatibility:</strong> Apache 1.3 and above <p>The <code>XhtmlNegLog</code> directive defines the path and filename of an optional log file. Status messages regarding success or failure to negotiate are sent to this log file. If this directive is not specified, no logging takes place. For example:</p> <pre> XhtmlNegLog /var/log/apache/mod_xhtml_neg.log </pre> <h2><a id="negtypes" name="negtypes">XhtmlNegTypes</a></h2> <strong>Syntax:</strong> XhtmlNegTypes <em>file-extension content-type1 content-type2...</em><br /> <strong>Context:</strong> server config, virtual host, directory, .htaccess<br /> <strong>Status:</strong> Extension<br /> <strong>Module:</strong> mod_xhtml_neg<br /> <strong>Compatibility:</strong> Apache 1.3 and above <p>The <code>XhtmlNegTypes</code> directive defines the content-negotiation for a given file extension. Each token contains a content-type, followed by optional charset value, relative quality, and profile information. For example:</p> <pre> XhtmlNegTypes .html application/xhtml+xml;charset=iso-8859-1 \ application/xml;q=0.5 text/html;charset=iso-8859-1;q=0.8 \ text/xml;charset=iso-8859-1;q=0.2 </pre> <p>This tells us that the content-type application/xhtml+xml is preferred, followed by text/html, application/xml, and finally text/xml.</p> <ul> <li>When a "q" parameter is not specified, 1.0 is assumed. Values for "q" should be between 0.0 and 1.0.</li> <li>If a "charset" parameter is not specified, the character set is taken from the <code>AddDefaultCharset</code> directive. If this is not specified, "iso-8859-1" is assumed unless the content type is "text/xml" or "text/xml-external-parsed-entity", where "us-ascii" is assumed.</li> <li>If a "profile" is not specified, none is assumed.</li> </ul> <p>If no match is found using content-negotiation, the default content type is used.</p> <p>Note that setting the <code>AddDefaultCharset</code> directive for the Apache core is recommended regardless of whether the "charset" parameter is specified.</p> <h2><a id="starsignore" name="starsignore">XhtmlNegStarsIgnore</a></h2> <strong>Syntax:</strong> XhtmlNegStarsIgnore <em>[0 - 3]</em><br /> <strong>Context:</strong> server config, virtual host, directory, .htaccess<br /> <strong>Status:</strong> Extension<br /> <strong>Module:</strong> mod_xhtml_neg<br /> <strong>Compatibility:</strong> Apache 1.3 and above <p>The <code>XhtmlNegStarsIgnore</code> directive indicates the number of stars ("*") in an Accept token that should be ignored when performing content-negotiation. This is used to get around bugs in certain user agents that send Accept headers of "*/*" in every request without assigning them a lower quality value.</p> <p>For example:</p> <pre> XhtmlNegStarsIgnore 2 </pre> <p>Here, Accept headers such as "text/html" or "text/*" will be considered when performing content-negotiation, but "*/*" will be ignored.</p> <p>Setting <code>XhtmlNegStarsIgnore 0</code> is effectively the same as disabling content-negotiation altogether. <code>XhtmlNegStarsIgnore 3</code> allows all Accept headers to be used for content-negotiation.</p> <h2><a id="negcache" name="negcache">XhtmlNegCache</a></h2> <strong>Syntax:</strong> XhtmlNegCache on|off<br /> <strong>Context:</strong> server config<br /> <strong>Status:</strong> Extension<br /> <strong>Module:</strong> mod_xhtml_neg<br /> <strong>Compatibility:</strong> Apache 1.3 and above <p>The <code>XhtmlNegCache</code> directive controls caching of negotiated content when the request is sent using HTTP 1.0. By default, caching is disabled due to problems with HTTP 1.0 proxies being unable to reliably give user agents the correct content-type.</p> <p>For HTTP 1.1 (and later) this directive has no effect, since HTTP 1.1 gives proxies the information they need in order to send correctly negotiated content to user-agents.</p> <hr /> </body> </html>