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