diff options
Diffstat (limited to 'docs/manual/mod/mod_headers.html.en')
-rw-r--r-- | docs/manual/mod/mod_headers.html.en | 110 |
1 files changed, 75 insertions, 35 deletions
diff --git a/docs/manual/mod/mod_headers.html.en b/docs/manual/mod/mod_headers.html.en index 2b9328dd..775e4def 100644 --- a/docs/manual/mod/mod_headers.html.en +++ b/docs/manual/mod/mod_headers.html.en @@ -8,11 +8,14 @@ <title>mod_headers - Apache HTTP Server</title> <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> -<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.js" type="text/javascript"> +</script> + <link href="../images/favicon.ico" rel="shortcut icon" /></head> <body> <div id="page-header"> -<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> <p class="apache">Apache HTTP Server Version 2.4</p> <img alt="" src="../images/feather.gif" /></div> <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> @@ -47,7 +50,7 @@ headers</td></tr> <li><img alt="" src="../images/down.gif" /> <a href="#order">Order of Processing</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#early">Early and Late Processing</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li> -</ul></div> +</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="order" id="order">Order of Processing</a></h2> @@ -60,10 +63,11 @@ headers</td></tr> order in the configuration file and by placement in <a href="../sections.html#mergin">configuration sections</a>. These two directives have a different effect if reversed:</p> - <div class="example"><p><code> - RequestHeader append MirrorID "mirror 12"<br /> - RequestHeader unset MirrorID - </code></p></div> + <pre class="prettyprint lang-config"> +RequestHeader append MirrorID "mirror 12" +RequestHeader unset MirrorID + </pre> + <p>This way round, the <code>MirrorID</code> header is not set. If reversed, the MirrorID header is set to "mirror 12".</p> @@ -97,9 +101,10 @@ headers</td></tr> Copy all request headers that begin with "TS" to the response headers: - <div class="example"><p><code> + <pre class="prettyprint lang-config"> Header echo ^TS - </code></p></div> + </pre> + </li> <li> @@ -109,9 +114,10 @@ headers</td></tr> the client to intuit load on the server or in isolating bottlenecks between the client and the server. - <div class="example"><p><code> + <pre class="prettyprint lang-config"> Header set MyHeader "%D %t" - </code></p></div> + </pre> + <p>results in this header being added to the response:</p> @@ -123,10 +129,10 @@ headers</td></tr> <li> Say hello to Joe - <div class="example"><p><code> - Header set MyHeader "Hello Joe. It took %D microseconds \<br /> - for Apache to serve this request." - </code></p></div> + <pre class="prettyprint lang-config"> +Header set MyHeader "Hello Joe. It took %D microseconds for Apache to serve this request." + </pre> + <p>results in this header being added to the response:</p> @@ -143,10 +149,11 @@ headers</td></tr> stimulus. Note that this example requires the services of the <code class="module"><a href="../mod/mod_setenvif.html">mod_setenvif</a></code> module. - <div class="example"><p><code> - SetEnvIf MyRequestHeader myvalue HAVE_MyRequestHeader<br /> - Header set MyHeader "%D %t mytext" env=HAVE_MyRequestHeader - </code></p></div> + <pre class="prettyprint lang-config"> +SetEnvIf MyRequestHeader myvalue HAVE_MyRequestHeader +Header set MyHeader "%D %t mytext" env=HAVE_MyRequestHeader + </pre> + <p>If the header <code>MyRequestHeader: myvalue</code> is present on the HTTP request, the response will contain the following header:</p> @@ -162,9 +169,10 @@ headers</td></tr> description</a>) by replacing <var>https:</var> with <var>http:</var> in the <var>Destination</var> header: - <div class="example"><p><code> + <pre class="prettyprint lang-config"> RequestHeader edit Destination ^https: http: early - </code></p></div> + </pre> + </li> <li> @@ -175,11 +183,12 @@ headers</td></tr> <code>NO_STORE</code> environment variables all existed for the request): - <div class="example"><p><code> - Header merge Cache-Control no-cache env=CGI<br /> - Header merge Cache-Control no-cache env=NO_CACHE<br /> - Header merge Cache-Control no-store env=NO_STORE - </code></p></div> + <pre class="prettyprint lang-config"> +Header merge Cache-Control no-cache env=CGI +Header merge Cache-Control no-cache env=NO_CACHE +Header merge Cache-Control no-store env=NO_STORE + </pre> + <p>then the response would contain the following header:</p> @@ -196,9 +205,10 @@ headers</td></tr> </li> <li> Set a test cookie if and only if the client didn't send us a cookie - <div class="example"><p><code> + <pre class="prettyprint lang-config"> Header set Set-Cookie testcookie "expr=-z %{req:Cookie}" - </code></p></div> + </pre> + </li> </ol> </div> @@ -206,8 +216,10 @@ headers</td></tr> <div class="directive-section"><h2><a name="Header" id="Header">Header</a> <a name="header" id="header">Directive</a></h2> <table class="directive"> <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configure HTTP response headers</td></tr> -<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Header [<var>condition</var>] add|append|echo|edit|merge|set|unset -<var>header</var> [<var>value</var>] [early|env=[!]<var>variable</var>]</code></td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Header [<var>condition</var>] add|append|echo|edit|edit*|merge|set|unset +<var>header</var> [<var>value</var>] [<var>replacement</var>] +[early|env=[!]<var>variable</var>]|expr=<var>expression</var>] +</code></td></tr> <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> @@ -271,10 +283,15 @@ headers</td></tr> <var>value</var> must be omitted.</dd> <dt><code>edit</code></dt> + <dt><code>edit*</code></dt> <dd>If this response 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> + is a replacement string, which may contain backreferences. + The <code>edit</code> form will match and replace exactly once + in a header value, whereas the <code>edit*</code> form will replace + <em>every</em> instance of the search pattern if it appears more + than once.</dd> <dt><code>merge</code></dt> <dd>The response header is appended to any existing header of @@ -371,8 +388,10 @@ headers</td></tr> <div class="directive-section"><h2><a name="RequestHeader" id="RequestHeader">RequestHeader</a> <a name="requestheader" id="requestheader">Directive</a></h2> <table class="directive"> <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configure HTTP request headers</td></tr> -<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RequestHeader add|append|edit|edit*|merge|set|unset <var>header</var> -[<var>value</var>] [<var>replacement</var>] [early|env=[!]<var>variable</var>]</code></td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RequestHeader add|append|edit|edit*|merge|set|unset +<var>header</var> [<var>value</var>] [<var>replacement</var>] +[early|env=[!]<var>variable</var>]|expr=<var>expression</var>] +</code></td></tr> <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> @@ -473,7 +492,28 @@ headers</td></tr> <a href="../fr/mod/mod_headers.html" hreflang="fr" rel="alternate" title="Français"> fr </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"> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_headers.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> <p class="apache">Copyright 2012 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> -<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> </body></html>
\ No newline at end of file |