2.3.121 RequestHeader
RequestHeader customizes the request header.
Description
RequestHeader customizes the header value received from the client.
Note that the mod_headers module needs to be implemented to customize the response header.
LoadModule headers_module modules/mod_headers.so
Syntax
RequestHeader {{set|append|add}header header_value[env=[!]environment_variable]|unset header}
Specifiable values
- set
-
Set the header. If the header already exists, it will be replaced with the specified header value.
- append
-
Add the header value to the existing header. A comma is placed to separate the headers. A header is set when no header exists.
- add
-
Set the header to a new line even if the header exists. Use this value to set the same header in multiple lines.
- unset
-
When a specified header exists, delete the entire header.
- env=environment_variable
-
Execute the content specified in the RequestHeader directive when the specified environment variable is set.
- env=!environment_variable
-
Execute the content specified in the RequestHeader directive when the specified environment variable is not set.
- header_value
-
A character string composed of characters only, a character string composed of a format directive, or a character string composed of both can be specified.
The header value must be enclosed in double quotation marks (") when the header value contains a space.
The format directives are as follows:
Format directive
Meaning
%t
Displays the time when the request was received, from the amount of time that has elapsed since midnight on January 1st, 1970 (GMT: Greenwich Mean Time). The units are in microseconds. t= is attached at the beginning.
%D
Displays the time taken for processing the request. The units are in microseconds. D= is attached at the beginning
%{env_name}e
Displays the value for the environment variable set in env_name.
Locations where it can be written
httpsd.conf, <VirtualHost>, <Directory> and .htaccess
Overwrite permission
FileInfo level
Example
RequestHeader set Host www.example.com