]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_html.html.en
rebuild everything
[apache] / docs / manual / mod / mod_proxy_html.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_proxy_html - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <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" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
13 </script>
14
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
16 <body>
17 <div id="page-header">
18 <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>
19 <p class="apache">Apache HTTP Server Version 2.5</p>
20 <img alt="" src="../images/feather.gif" /></div>
21 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
22 <div id="path">
23 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
24 <div id="page-content">
25 <div id="preamble"><h1>Apache Module mod_proxy_html</h1>
26 <div class="toplang">
27 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_html.html" title="English">&nbsp;en&nbsp;</a></p>
28 </div>
29 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Rewrite HTML links in to ensure they are addressable
30 from Clients' networks in a proxy context.</td></tr>
31 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
32 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_html_module</td></tr>
33 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy_html.c</td></tr>
34 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later.  Available as a third-party module
35 for earlier 2.x versions</td></tr></table>
36 <h3>Summary</h3>
37
38     <p>This module provides an output filter to rewrite HTML links in a proxy situation, to ensure that links work for users outside the proxy. It serves the same purpose as Apache's ProxyPassReverse directive does for HTTP headers, and is an essential component of a reverse proxy.</p>
39
40 <p>For example, if a company has an application server at appserver.example.com that is only visible from within the company's internal network, and a public webserver <code>www.example.com</code>, they may wish to provide a gateway to the application server at <code>http://www.example.com/appserver/</code>. When the application server links to itself, those links need to be rewritten to work through the gateway. mod_proxy_html serves to rewrite <code>&lt;a href="http://appserver.example.com/foo/bar.html"&gt;foobar&lt;/a&gt;</code> to <code>&lt;a href="http://www.example.com/appserver/foo/bar.html"&gt;foobar&lt;/a&gt;</code> making it accessible from outside.</p>
41
42 <p>mod_proxy_html was originally developed at WebÞing, whose
43 extensive <a href="http://apache.webthing.com/mod_proxy_html/">documentation</a> may be useful to users.</p>
44 </div>
45 <div id="quickview"><h3 class="directives">Directives</h3>
46 <ul id="toc">
47 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlbufsize">ProxyHTMLBufSize</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlcharsetout">ProxyHTMLCharsetOut</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmldoctype">ProxyHTMLDocType</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlenable">ProxyHTMLEnable</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlevents">ProxyHTMLEvents</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlextended">ProxyHTMLExtended</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlfixups">ProxyHTMLFixups</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlinterp">ProxyHTMLInterp</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmllinks">ProxyHTMLLinks</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlmeta">ProxyHTMLMeta</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlstripcomments">ProxyHTMLStripComments</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlurlmap">ProxyHTMLURLMap</a></li>
59 </ul>
60 <ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
61
62 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
63 <div class="directive-section"><h2><a name="ProxyHTMLBufSize" id="ProxyHTMLBufSize">ProxyHTMLBufSize</a> <a name="proxyhtmlbufsize" id="proxyhtmlbufsize">Directive</a></h2>
64 <table class="directive">
65 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the buffer size increment for buffering inline scripts and
66 stylesheets.</td></tr>
67 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLBufSize <var>bytes</var></code></td></tr>
68 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
69 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
70 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
71 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
72 for earlier 2.x versions</td></tr>
73 </table>
74 <p>In order to parse non-HTML content (stylesheets and scripts), mod_proxy_html
75 has to read the entire script or stylesheet into a buffer.  This buffer will
76 be expanded as necessary to hold the largest script or stylesheet in a page,
77 in increments of [nnnn] as set by this directive.</p>
78 <p>The default is 8192, and will work well for almost all pages.  However,
79 if you know you're proxying a lot of pages containing stylesheets and/or
80 scripts bigger than 8K (that is, for a single script or stylesheet,
81 NOT in total), it will be more efficient to set a larger buffer
82 size and avoid the need to resize the buffer dynamically during a request.
83 </p>
84
85 </div>
86 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
87 <div class="directive-section"><h2><a name="ProxyHTMLCharsetOut" id="ProxyHTMLCharsetOut">ProxyHTMLCharsetOut</a> <a name="proxyhtmlcharsetout" id="proxyhtmlcharsetout">Directive</a></h2>
88 <table class="directive">
89 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify a charset for mod_proxy_html output.</td></tr>
90 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLCharsetOut <var>Charset | *</var></code></td></tr>
91 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
92 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
93 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
94 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
95 for earlier 2.x versions</td></tr>
96 </table>
97 <p>This selects an encoding for mod_proxy_html output.  It should not
98 normally be used, as any change from the default <code>UTF-8</code>
99 (Unicode - as used internally by libxml2) will impose an additional
100 processing overhead.  The special token <code>ProxyHTMLCharsetOut *</code>
101 will generate output using the same encoding as the input.</p>
102 <p>Note that this relies on <code class="module"><a href="../mod/mod_xml2enc.html">mod_xml2enc</a></code> being loaded.</p>
103
104 </div>
105 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
106 <div class="directive-section"><h2><a name="ProxyHTMLDocType" id="ProxyHTMLDocType">ProxyHTMLDocType</a> <a name="proxyhtmldoctype" id="proxyhtmldoctype">Directive</a></h2>
107 <table class="directive">
108 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets an HTML or XHTML document type declaration.</td></tr>
109 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLDocType <var>HTML|XHTML [Legacy]</var><br /><strong>OR</strong>
110 <br />ProxyHTMLDocType <var>fpi [SGML|XML]</var></code></td></tr>
111 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
112 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
113 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
114 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
115 for earlier 2.x versions</td></tr>
116 </table>
117 <p>In the first form, documents will be declared as HTML 4.01 or XHTML 1.0
118 according to the option selected.  This option also determines whether
119 HTML or XHTML syntax is used for output.   Note that the format of the
120 documents coming from the backend server is immaterial: the parser will
121 deal with it automatically.  If the optional second argument is set to
122 "Legacy", documents will be declared "Transitional", an option that may
123 be necessary if you are proxying pre-1998 content or working with defective
124 authoring/publishing tools.</p>
125 <p>In the second form, it will insert your own FPI.  The optional second
126 argument determines whether SGML/HTML or XML/XHTML syntax will be used.</p>
127 <p>The default is changed to omitting any FPI,
128 on the grounds that no FPI is better than a bogus one.  If your backend
129 generates decent HTML or XHTML, set it accordingly.</p>
130 <p>If the first form is used, mod_proxy_html
131 will also clean up the HTML to the specified standard.  It cannot
132 fix every error, but it will strip out bogus elements and attributes.
133 It will also optionally log other errors at <code class="directive"><a href="../mod/core.html#loglevel">LogLevel</a></code> Debug.</p>
134
135 </div>
136 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
137 <div class="directive-section"><h2><a name="ProxyHTMLEnable" id="ProxyHTMLEnable">ProxyHTMLEnable</a> <a name="proxyhtmlenable" id="proxyhtmlenable">Directive</a></h2>
138 <table class="directive">
139 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Turns the proxy_html filter on or off.</td></tr>
140 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLEnable <var>On|Off</var></code></td></tr>
141 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
142 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
143 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
144 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
145 module for earlier 2.x versions.</td></tr>
146 </table>
147     <p>A simple switch to enable or disable the proxy_html filter.
148     If <code class="module"><a href="../mod/mod_xml2enc.html">mod_xml2enc</a></code> is loaded it will also automatically
149     set up internationalisation support.</p>
150     <p>Note that the proxy_html filter will only act on HTML data
151     (Content-Type text/html or application/xhtml+xml) and when the
152     data are proxied.  You can override this (at your own risk) by
153     setting the <var>PROXY_HTML_FORCE</var> environment variable.</p>
154
155 </div>
156 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
157 <div class="directive-section"><h2><a name="ProxyHTMLEvents" id="ProxyHTMLEvents">ProxyHTMLEvents</a> <a name="proxyhtmlevents" id="proxyhtmlevents">Directive</a></h2>
158 <table class="directive">
159 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify attributes to treat as scripting events.</td></tr>
160 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLEvents <var>attribute [attribute ...]</var></code></td></tr>
161 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
162 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
163 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
164 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
165 for earlier 2.x versions</td></tr>
166 </table>
167 <p>Specifies one or more attributes to treat as scripting events and
168 apply <code class="directive">ProxyHTMLURLMap</code>s to where appropriate.
169 You can specify any number of attributes in one or more
170 <code>ProxyHTMLEvents</code> directives.</p>
171 <p>The default configuration defines the events in standard HTML 4
172 and XHTML 1.</p>
173
174 </div>
175 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
176 <div class="directive-section"><h2><a name="ProxyHTMLExtended" id="ProxyHTMLExtended">ProxyHTMLExtended</a> <a name="proxyhtmlextended" id="proxyhtmlextended">Directive</a></h2>
177 <table class="directive">
178 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether to fix links in inline scripts, stylesheets,
179 and scripting events.</td></tr>
180 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLExtended <var>On|Off</var></code></td></tr>
181 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
182 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
183 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
184 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
185 for earlier 2.x versions</td></tr>
186 </table>
187 <p>Set to <code>Off</code>, HTML links are rewritten according
188 <code class="directive">ProxyHTMLURLMap</code> directives, but links appearing
189 in Javascript and CSS are ignored.</p>
190 <p>Set to <code>On</code>, all scripting events and embedded scripts or
191 stylesheets are also processed by the <code class="directive">ProxyHTMLURLMap</code>
192 rules, according to the flags set for each rule.  Since this requires more
193 parsing, performance will be best if you only enable it when strictly necessary.</p>
194
195 </div>
196 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
197 <div class="directive-section"><h2><a name="ProxyHTMLFixups" id="ProxyHTMLFixups">ProxyHTMLFixups</a> <a name="proxyhtmlfixups" id="proxyhtmlfixups">Directive</a></h2>
198 <table class="directive">
199 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Fixes for simple HTML errors.</td></tr>
200 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLFixups <var>[lowercase] [dospath] [reset]</var></code></td></tr>
201 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
202 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
203 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
204 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
205 for earlier 2.x versions</td></tr>
206 </table>
207 <p>This directive takes one to three arguments as follows:</p>
208 <ul>
209 <li><code>lowercase</code> Urls are rewritten to lowercase</li>
210 <li><code>dospath</code> Backslashes in URLs are rewritten to forward slashes.</li>
211 <li><code>reset</code> Unset any options set at a higher level in the configuration.</li>
212 </ul>
213 <p>Take care when using these.  The fixes will correct certain authoring
214 mistakes, but risk also erroneously fixing links that were correct to start with.
215 Only use them if you know you have a broken backend server.</p> 
216
217 </div>
218 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
219 <div class="directive-section"><h2><a name="ProxyHTMLInterp" id="ProxyHTMLInterp">ProxyHTMLInterp</a> <a name="proxyhtmlinterp" id="proxyhtmlinterp">Directive</a></h2>
220 <table class="directive">
221 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables per-request interpolation of
222 <code class="directive">ProxyHTMLURLMap</code> rules.</td></tr>
223 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLInterp <var>On|Off</var></code></td></tr>
224 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
225 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
226 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
227 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
228 for earlier 2.x versions</td></tr>
229 </table>
230     <p>This enables per-request interpolation in
231     <code class="directive">ProxyHTMLURLMap</code> to- and from- patterns.</p>
232     <p>If interpolation is not enabled, all rules are pre-compiled at startup.
233     With interpolation, they must be re-compiled for every request, which
234     implies an extra processing overhead.  It should therefore be
235     enabled only when necessary.</p>
236
237 </div>
238 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
239 <div class="directive-section"><h2><a name="ProxyHTMLLinks" id="ProxyHTMLLinks">ProxyHTMLLinks</a> <a name="proxyhtmllinks" id="proxyhtmllinks">Directive</a></h2>
240 <table class="directive">
241 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify HTML elements that have URL attributes to be rewritten.</td></tr>
242 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLLinks <var>element attribute [attribute2 ...]</var></code></td></tr>
243 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
244 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
245 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
246 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
247 for earlier 2.x versions</td></tr>
248 </table>
249 <p>Specifies elements that have URL attributes that should be rewritten
250 using standard <code class="directive">ProxyHTMLURLMap</code>s.  You will need one
251 ProxyHTMLLinks directive per element, but it can have any number of attributes.</p>
252 <p>The default configuration defines the HTML links for standard HTML 4
253 and XHTML 1.</p>
254
255 </div>
256 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
257 <div class="directive-section"><h2><a name="ProxyHTMLMeta" id="ProxyHTMLMeta">ProxyHTMLMeta</a> <a name="proxyhtmlmeta" id="proxyhtmlmeta">Directive</a></h2>
258 <table class="directive">
259 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Turns on or off extra pre-parsing of metadata in HTML
260 <code>&lt;head&gt;</code> sections.</td></tr>
261 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLMeta <var>On|Off</var></code></td></tr>
262 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
263 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
264 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
265 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
266 module for earlier 2.x versions.</td></tr>
267 </table>
268     <p>This turns on or off pre-parsing of metadata in HTML
269     <code>&lt;head&gt;</code> sections.</p>
270     <p>If not required, turning ProxyHTMLMeta Off will give a small
271     performance boost by skipping this parse step.  However, it
272     is sometimes necessary for internationalisation to work correctly.</p>
273     <p>ProxyHTMLMeta has two effects.  Firstly and most importantly
274     it enables detection of character encodings declared in the form</p>
275     <pre>&lt;meta http-equiv="Content-Type" content="text/html;charset=<var>foo</var>"&gt;</pre>
276     <p>or, in the case of an XHTML document, an XML declaration.
277     It is NOT required if the charset is declared in a real HTTP header
278     (which is always preferable) from the backend server, nor if the
279     document is <var>utf-8</var> (unicode) or a subset such as ASCII.
280     You may also be able to dispense with it where documents use a
281     default declared using <code class="directive"><a href="../mod/mod_xml2enc.html#xml2encdefault">xml2EncDefault</a></code>, but that risks propagating an
282     incorrect declaration.  A <code class="directive">ProxyHTMLCharsetOut</code>
283     can remove that risk, but is likely to be a bigger processing
284     overhead than enabling ProxyHTMLMeta.</p>
285     <p>The other effect of enabling ProxyHTMLMeta is to parse all
286     <code>&lt;meta http-equiv=...&gt;</code> declarations and convert
287     them to real HTTP headers, in keeping with the original purpose
288     of this form of the HTML &lt;meta&gt; element.</p>
289
290 </div>
291 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
292 <div class="directive-section"><h2><a name="ProxyHTMLStripComments" id="ProxyHTMLStripComments">ProxyHTMLStripComments</a> <a name="proxyhtmlstripcomments" id="proxyhtmlstripcomments">Directive</a></h2>
293 <table class="directive">
294 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether to strip HTML comments.</td></tr>
295 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLStripComments <var>On|Off</var></code></td></tr>
296 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
297 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
298 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
299 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
300 for earlier 2.x versions</td></tr>
301 </table>
302 <p>This directive will cause mod_proxy_html to strip HTML comments.
303 Note that this will also kill off any scripts or styles embedded in
304 comments (a bogosity introduced in 1995/6 with Netscape 2 for the
305 benefit of then-older browsers, but still in use today).
306 It may also interfere with comment-based processors such as SSI or ESI:
307 be sure to run any of those <em>before</em> mod_proxy_html in the
308 filter chain if stripping comments!</p>
309
310 </div>
311 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
312 <div class="directive-section"><h2><a name="ProxyHTMLURLMap" id="ProxyHTMLURLMap">ProxyHTMLURLMap</a> <a name="proxyhtmlurlmap" id="proxyhtmlurlmap">Directive</a></h2>
313 <table class="directive">
314 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Defines a rule to rewrite HTML links</td></tr>
315 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLURLMap <var>from-pattern to-pattern [flags] [cond]</var></code></td></tr>
316 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
317 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
318 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
319 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
320 module for earlier 2.x versions.</td></tr>
321 </table>
322 <p>This is the key directive for rewriting HTML links.  When parsing a document,
323 whenever a link target matches <var>from-pattern</var>, the matching
324 portion will be rewritten to <var>to-pattern</var>, as modified by any
325 flags supplied.</p>
326
327 <p>The optional third argument may define any of the following
328 <strong>Flags</strong>.  Flags are case-sensitive.</p>
329 <dl>
330 <dt>h</dt>
331 <dd><p>Ignore HTML links (pass through unchanged)</p></dd>
332 <dt>e</dt>
333 <dd><p>Ignore scripting events (pass through unchanged)</p></dd>
334 <dt>c</dt>
335 <dd><p>Pass embedded script and style sections through untouched.</p></dd>
336
337 <dt>L</dt>
338 <dd><p>Last-match.  If this rule matches, no more rules are applied
339 (note that this happens automatically for HTML links).</p></dd>
340 <dt>l</dt>
341 <dd><p>Opposite to L.  Overrides the one-change-only default
342 behaviour with HTML links.</p></dd>
343 <dt>R</dt>
344 <dd><p>Use Regular Expression matching-and-replace.  <code>from-pattern</code>
345 is a regexp, and <code>to-pattern</code> a replacement string that may be
346 based on the regexp.  Regexp memory is supported: you can use brackets ()
347 in the <code>from-pattern</code> and retrieve the matches with $1 to $9
348 in the <code>to-pattern</code>.</p>
349
350 <p>If R is not set, it will use string-literal search-and-replace.
351 The logic is <em>starts-with</em> in HTML links, but
352 <em>contains</em> in scripting events and embedded script and style sections.
353 </p>
354 </dd>
355 <dt>x</dt>
356 <dd><p>Use POSIX extended Regular Expressions.  Only applicable with R.</p></dd>
357 <dt>i</dt>
358 <dd><p>Case-insensitive matching.  Only applicable with R.</p></dd>
359
360 <dt>n</dt>
361 <dd><p>Disable regexp memory (for speed).  Only applicable with R.</p></dd>
362 <dt>s</dt>
363 <dd><p>Line-based regexp matching.  Only applicable with R.</p></dd>
364 <dt>^</dt>
365 <dd><p>Match at start only.  This applies only to string matching
366 (not regexps) and is irrelevant to HTML links.</p></dd>
367 <dt>$</dt>
368 <dd><p>Match at end only.  This applies only to string matching
369 (not regexps) and is irrelevant to HTML links.</p></dd>
370 <dt>V</dt>
371 <dd><p>Interpolate environment variables in <code>to-pattern</code>.
372 A string of the form <code>${varname|default}</code> will be replaced by the
373 value of environment variable <code>varname</code>.  If that is unset, it
374 is replaced by <code>default</code>.  The <code>|default</code> is optional.</p>
375 <p>NOTE: interpolation will only be enabled if
376 <code class="directive">ProxyHTMLInterp</code> is <var>On</var>.</p>
377 </dd>
378
379 <dt>v</dt>
380 <dd><p>Interpolate environment variables in <code>from-pattern</code>.
381 Patterns supported are as above.</p>
382 <p>NOTE: interpolation will only be enabled if
383 <code class="directive">ProxyHTMLInterp</code> is <var>On</var>.</p>
384 </dd>
385 </dl>
386
387 <p>The optional fourth <strong>cond</strong> argument defines a condition
388 that will be evaluated per Request, provided
389 <code class="directive">ProxyHTMLInterp</code> is <var>On</var>.
390 If the condition evaluates FALSE the map will not be applied in this request.
391 If TRUE, or if no condition is defined, the map is applied.</p>
392 <p>A <strong>cond</strong> is evaluated by the <a href="../expr.html">Expression Parser</a>.  In addition, the simpler syntax of conditions
393 in mod_proxy_html 3.x for HTTPD 2.0 and 2.2 is also supported.</p>
394
395 </div>
396 </div>
397 <div class="bottomlang">
398 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_html.html" title="English">&nbsp;en&nbsp;</a></p>
399 </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&amp;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>
400 <script type="text/javascript"><!--//--><![CDATA[//><!--
401 var comments_shortname = 'httpd';
402 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_proxy_html.html';
403 (function(w, d) {
404     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
405         d.write('<div id="comments_thread"><\/div>');
406         var s = d.createElement('script');
407         s.type = 'text/javascript';
408         s.async = true;
409         s.src = 'http://c.apaste.info/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
410         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
411     }
412     else {
413         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
414     }
415 })(window, document);
416 //--><!]]></script></div><div id="footer">
417 <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>
418 <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[//><!--
419 if (typeof(prettyPrint) !== 'undefined') {
420     prettyPrint();
421 }
422 //--><!]]></script>
423 </body></html>