From: André Malo Topics
@@ -68,6 +69,27 @@ is available only in Apache 2.0
reversed, the MirrorID header is set to "mirror 12".
mod_headers
can be applied either early or late
+ in the request. The normal mode is late, when Request Headers are
+ set immediately before running the content generator and Response
+ Headers just as the response is sent down the wire. Always use
+ Late mode in an operational server.
Early mode is designed as a test/debugging aid for developers.
+ Directives defined using the early
keyword are set
+ right at the beginning of processing the request. This means
+ they can be used to simulate different requests and set up test
+ cases, but it also means that headers may be changed at any time
+ by other modules before generating a Response.
Because early directives are processed before the request path's
+ configuration is traversed, early headers can only be set in a
+ main server or virtual host context. Early directives cannot depend
+ on a request path, so they will fail in contexts such as
+ <Directory>
or <Location>
.
Description: | Configure HTTP response headers |
---|---|
Syntax: | Header [condition] set|append|add|unset|echo
-header [value] [env=[!]variable] |
Context: | server config, virtual host, directory, .htaccess |
Override: | FileInfo |
Status: | Extension |
The Header
directive may be followed by an
- additional argument, which may be used to specify conditions
- under which the action will be taken. If the environment variable specified in the
+ an additional argument, which may be used to specify conditions under
+ which the action will be taken, or may be the keyword early
+ to specify early processing. If the
+ environment variable specified in the
env=...
argument exists (or if the environment
variable does not exist and env=!...
is specified)
then the action specified by the Header
directive
will take effect. Otherwise, the directive will have no effect
on the request.
The Header
directives are processed just
+
Except in early mode, the
+ Header
directives are processed just
before the response is sent to the network. These means that it is
possible to set and/or override most headers, except for those headers
added by the header filter.
Description: | Configure HTTP request headers |
---|---|
Syntax: | RequestHeader set|append|add|unset header
-[value] [env=[!]variable] |
Context: | server config, virtual host, directory, .htaccess |
Override: | FileInfo |
Status: | Extension |
The RequestHeader
directive may be followed by
an additional argument, which may be used to specify conditions under
- which the action will be taken. If the environment
+ which the action will be taken, or may be the keyword early
+ to specify early processing. If the
+ environment
variable specified in the env=...
argument
exists (or if the environment variable does not exist and
env=!...
is specified) then the action specified
by the RequestHeader
directive will take effect.
Otherwise, the directive will have no effect on the request.
The RequestHeader
directive is processed
+
Except in early mode, the
+ RequestHeader
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.