mod_headers.html revision 4e59fdbc3e0d0c17a28469c9efbc0a071622d5ec
0N/A<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2263N/A<HTML>
0N/A<HEAD>
0N/A<TITLE>Apache module mod_headers</TITLE>
0N/A</HEAD>
0N/A
0N/A<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
0N/A<BODY
0N/A BGCOLOR="#FFFFFF"
0N/A TEXT="#000000"
0N/A LINK="#0000FF"
0N/A VLINK="#000080"
0N/A ALINK="#FF0000"
0N/A>
0N/A<!--#include virtual="header.html" -->
0N/A<H1 ALIGN="CENTER">Module mod_headers</H1>
0N/A
0N/A<p>This module provides for the customization of HTTP
1472N/Aresponse headers.</p>
1472N/A
1472N/A<P><A
0N/AHREF="module-dict.html#Status"
0N/AREL="Help"
0N/A><STRONG>Status:</STRONG></A> Extension
1879N/A<BR>
1879N/A<A
1879N/AHREF="module-dict.html#SourceFile"
1879N/AREL="Help"
1879N/A><STRONG>Source File:</STRONG></A> mod_headers.c
2062N/A<BR>
1879N/A<A
1879N/AHREF="module-dict.html#ModuleIdentifier"
1879N/AREL="Help"
1879N/A><STRONG>Module Identifier:</STRONG></A> headers_module
1879N/A</P>
1879N/A
1879N/A<h2>Summary</h2>
1879N/A
1879N/AThis module provides a directive to control the sending of HTTP
1879N/Aheaders. Headers can be merged, replaced or removed.
1879N/A
2073N/A<H2>Directives</H2>
2073N/A<UL>
2073N/A<LI><A HREF="#header">Header</A>
2073N/A</UL>
2073N/A
2073N/A<HR>
1879N/A
0N/A<H2><A NAME="header">Header</A> directive</H2>
0N/A<A
0N/A HREF="directive-dict.html#Syntax"
0N/A REL="Help"
0N/A><STRONG>Syntax:</STRONG></A> Header [ set | append | add ]
0N/A <EM>header</EM> <EM>value</EM><BR>
0N/A<A
0N/A HREF="directive-dict.html#Syntax"
2062N/A REL="Help"
0N/A><STRONG>Syntax:</STRONG></A> Header unset <EM>header</EM><BR>
0N/A<A
0N/A HREF="directive-dict.html#Context"
2062N/A REL="Help"
2062N/A><STRONG>Context:</STRONG></A> server config, virtual host, access.conf,
2062N/A .htaccess<BR>
2062N/A<A
2062N/A HREF="directive-dict.html#Override"
2062N/A REL="Help"
2062N/A><STRONG>Override:</STRONG></A> FileInfo<BR>
2062N/A<A
2062N/A HREF="directive-dict.html#Status"
2062N/A REL="Help"
2062N/A><STRONG>Status:</STRONG></A> Extension<BR>
2062N/A<A
2062N/A HREF="directive-dict.html#Module"
2062N/A REL="Help"
2062N/A><STRONG>Module:</STRONG></A> mod_header<P>
2062N/A
2062N/AThis directive can replace, merge or remove HTTP response headers. The
2062N/Aaction it performs is determined by the first argument. This can be one
2062N/Aof the following values:
2062N/A
2062N/A<UL>
2062N/A<LI><STRONG>set</STRONG><BR>
113N/A The response header is set, replacing any previous header with this name
0N/A
0N/A<LI><STRONG>append</STRONG><BR>
0N/A The response header is appended to any existing header of the same
0N/A name. When a new value is merged onto an existing header it is
0N/A separated from the existing header with a comma. This is the HTTP standard
0N/A way of giving a header multiple values.
1833N/A
431N/A<LI><STRONG>add</STRONG><BR>
113N/A The response header is added to the existing set of headers, even if
518N/A this header already exists. This can result in two (or more) headers
518N/A having the same name. This can lead to unforeseen consequences, and in
0N/A general "append" should be used instead.
0N/A
0N/A<LI><STRONG>unset</STRONG><BR>
0N/A The response header of this name is removed, if it exists. If there are
0N/A multiple headers of the same name, all will be removed.
0N/A</UL>
0N/A
1833N/AThis argument is followed by a header name, which can include the
1833N/Afinal colon, but it is not required. Case is ignored. For
431N/Aadd, append and set a value is given as the third argument. If this
726N/Avalue contains spaces, it should be surrounded by double quotes.
431N/AFor unset, no value should be given.
431N/A
431N/A<H3>Order of Processing</H3>
431N/A
431N/AThe Header directive can occur almost anywhere within the server
431N/Aconfiguration. It is valid in the main server config and virtual host
431N/Asections, inside &lt;Directory&gt;, &lt;Location&gt; and &lt;Files&gt;
431N/Asections, and within .htaccess files.
431N/A<P>
0N/AThe Header directives are processed in the following order:
0N/A<OL>
0N/A<LI>main server
0N/A<LI>virtual host
1833N/A<LI>&lt;Directory&gt; sections and .htaccess
0N/A<LI>&lt;Location&gt;
2062N/A<LI>&lt;Files&gt;
2062N/A</OL>
2062N/A
2062N/AOrder is important. These two headers have a different effect if reversed:
2062N/A<PRE>
2062N/AHeader append Author "John P. Doe"
2062N/AHeader unset Author
2062N/A</PRE>
2062N/A
2062N/AThis way round, the Author header is not set. If reversed, the Author
2062N/Aheader is set to "John P. Doe".
2062N/A<P>
2062N/A
2062N/AThe Header directives are processed just before the response is sent
2062N/Aby its handler. These means that some headers that are added just
2062N/Abefore the response is sent cannot be unset or overridden. This
2062N/Aincludes headers such as "Date" and "Server".
2062N/A<P>
2062N/A
2062N/A<!--#include virtual="footer.html" -->
2062N/A</BODY>
0N/A</HTML>
0N/A