mod_headers.html revision 240a5b8962329911d02566b600be6226e1f857ae
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M SlusarzXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
630c1df5b6aaec452b0ef040df56cffd978fe9c3Timo Sirainen This file is generated from xml source: DO NOT EDIT
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M SlusarzXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz--><title>mod_headers - Apache HTTP Server</title><link rel="stylesheet" type="text/css" href="/style/manual.css"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_headers</h1><table bgcolor="#cccccc" cellpadding="0" cellspacing="1"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>Customization of HTTP request
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz and response headers</td></tr><tr><td><a class="help" href="module-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="module-dict.html#ModuleIdentifier">Module Identifier:</a></td><td>headers_module</td></tr><tr><td valign="top" align="left"><a class="help" href="module-dict.html#Compatibility">Compatibility:</a></td><td><compatibility>RequestHeader is available only in Apache 2.0</compatibility></td></tr></table></td></tr></table><h2>Summary</h2>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz <p>This module provides directives to control and modify HTTP
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz request and response headers. Headers can be merged, replaced
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz or removed.</p>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz<h2>Directives</h2><ul><li><a href="#header">Header</a></li><li><a href="#requestheader">RequestHeader</a></li></ul><h2>Order of Processing</h2>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz <p>The directives provided by mod_header can occur almost
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz anywhere within the server configuration. They are valid in the
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz main server config and virtual host sections, inside
1265ab7fdd2e88a1f4b1057593c5e0dbe3fb757aMichael M Slusarz <Directory>, <Location> and <Files> sections,
1265ab7fdd2e88a1f4b1057593c5e0dbe3fb757aMichael M Slusarz and within .htaccess files.</p>
1265ab7fdd2e88a1f4b1057593c5e0dbe3fb757aMichael M Slusarz <p>The directives are processed in the following order:</p>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz <li><Directory> sections and .htaccess</li>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz <p>Order is important. These two headers have a different
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz effect if reversed:</p>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M SlusarzRequestHeader append MirrorID "mirror 12"<br/>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz RequestHeader unset MirrorID
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz <p>This way round, the MirrorID header is not set. If reversed,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz the MirrorID header is set to "mirror 12".</p>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz <li>Copy all request headers that begin with "TS" to the
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz response headers:
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz Header echo ^TS*
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz</code></td></tr></table></blockquote></li>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz <li>Add a header, MyHeader, to the response including a
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz timestamp for when the request was received and how long it
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz took to begin serving the request. This header can be used by
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz the client to intuit load on the server or in isolating
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz bottlenecks between the client and the server.
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz Header add MyHeader "%D %t"
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz results in this header being added to the response:
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz MyHeader: D=3775428 t=991424704447256
<hr/><h2><a name="Header">Header</a> <a name="header">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Configure HTTP response headers</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>Header set|append|add|unset|echo <em>header</em>
[<em>value</em>]</td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td>FileInfo</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_headers</td></tr></table></td></tr></table>
under which the action will be taken. If the <a href="/env.html">environment variable</a> specified in the
<hr/><h2><a name="RequestHeader">RequestHeader</a> <a name="requestheader">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Configure HTTP request headers</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>RequestHeader set|append|add|unset <em>header</em>
[<em>value</em>]</td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td>FileInfo</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_headers</td></tr></table></td></tr></table>