RewriteHeader directive

Description: Rewrites any HTTP header in request
Syntax: RewriteHeader HeaderName: Pattern Substitution [flags]
Context: server config, virtual host, directory, .htaccess


RewriteHeader directive is more general variant of RewriteRule directive and it is designed to rewrite not only the URL part of client request, but any HTTP header. Technically RewriteRule directive is equivalent to the RewriteHeader URL Pattern Substitution [flags]. This directive can be used to rewrite, create or delete any HTTP headers in the client request before it will be processed by further applications on IIS.

HeaderName: specifies name of HTTP header that will be rewritten.

Pattern, Substitution and flags are the same as for RewriteRule directive.