<dd>If this request header exists, its value is transformed according
to a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
search-and-replace. The <var>value</var> argument is a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>, and the <var>replacement</var>
is a replacement string, which may contain backreferences.</dd>
</dl>
<p>This argument is followed by a <var>header</var> name, which
can include the final colon, but it is not required. Case is
ignored for <code>set</code>, <code>append</code>, <code>add</code>,
<code>unset</code>, and <code>edit</code>.
The <var>header</var> name for <code>echo</code>
is case sensitive and may be a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular
expression</a>.</p>
<p>For <code>set</code>, <code>append</code> and <code>add</code> a
<var>value</var> is specified as the third argument. If <var>value</var>
contains spaces, it should be surrounded by double quotes.
<var>value</var> may be a character string, a string containing format
specifiers or a combination of both. The following format specifiers
<p>This directive can replace, merge, change or remove HTTP request
headers. The header is modified just before the content handler
is run, allowing incoming headers to be modified. The action it
performs is determined by the first argument. This can be one
of the following values:</p>
<dl>
<dt><code>set</code></dt>
<dd>The request header is set, replacing any previous header
with this name</dd>
<dt><code>append</code></dt>
<dd>The request header is appended to any existing header of the
same name. When a new value is merged onto an existing header
it is separated from the existing header with a comma. This
is the HTTP standard way of giving a header multiple
values.</dd>
<dt><code>add</code></dt>
<dd>The request header is added to the existing set of headers,
even if this header already exists. This can result in two
(or more) headers having the same name. This can lead to
unforeseen consequences, and in general <code>set</code> or
<code>append</code> should be used instead.</dd>
<dt><code>unset</code></dt>
<dd>The request header of this name is removed, if it exists. If
there are multiple headers of the same name, all will be removed.
<var>value</var> must be omitted.</dd>
<dt><code>edit</code></dt>
<dd>If this request header exists, its value is transformed according
to a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
search-and-replace. The <var>value</var> argument is a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>, and the <var>replacement</var>
is a replacement string, which may contain backreferences.</dd>
</dl>
<p>This argument is followed by a header name, which can
include the final colon, but it is not required. Case is
ignored. For <code>set</code>, <code>append</code> and
<code>add</code> a <var>value</var> is given as the third argument. If a
<var>value</var> contains spaces, it should be surrounded by double
quotes. For <code>unset</code>, no <var>value</var> should be given.
<var>value</var> may be a character string, a string containing format
specifiers or a combination of both. The supported format specifiers
are the same as for the <code class="directive"><a href="#header">Header</a></code>,
please have a look there for details. For <code>edit</code> both
a <var>value</var> and a <var>replacement</var> are required, and are
a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a> and a
replacement string respectively.</p>
<p>The <code class="directive">RequestHeader</code> directive may be followed by
an additional argument, which may be used to specify conditions under
which the action will be taken, or may be the keyword <code>early</code>
to specify <a href="#early">early processing</a>. If the
<a href="../env.html">environment
variable</a> specified in the <code>env=<var>...</var></code> argument
exists (or if the environment variable does not exist and
<code>env=!<var>...</var></code> is specified) then the action specified
by the <code class="directive">RequestHeader</code> directive will take effect.
Otherwise, the directive will have no effect on the request.</p>
<p>Except in <a href="#early">early</a> mode, the
<code class="directive">RequestHeader</code> directive is processed
just before the request is run by its handler in the fixup phase.
This should allow headers generated by the browser, or by Apache
input filters to be overridden or modified.</p>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/mod/mod_headers.html" title="English"> en </a> |
<a href="../ja/mod/mod_headers.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../ko/mod/mod_headers.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div><div id="footer">
<p class="apache">Copyright 2007 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>