]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_html.html.en
96262f0de5635790072f8f19dc075f076e0f0942
[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" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <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>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <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.3</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_proxy_html</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_html.html" title="English">&nbsp;en&nbsp;</a></p>
25 </div>
26 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Rewrite HTML links in to ensure they are addressable
27 from Clients' networks in a proxy context.</td></tr>
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
29 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_html_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy_html.c</td></tr>
31 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later.  Available as a third-party module
32 for earlier 2.x versions</td></tr></table>
33 <h3>Summary</h3>
34
35     <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>
36
37 <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>
38
39 <p>mod_proxy_html was originally developed at WebÞing, whose
40 extensive <a href="http://apache.webthing.com/mod_proxy_html/">documentation</a> may be useful to users.</p>
41 </div>
42 <div id="quickview"><h3 class="directives">Directives</h3>
43 <ul id="toc">
44 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlbufsize">ProxyHTMLBufSize</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlcharsetout">ProxyHTMLCharsetOut</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmldoctype">ProxyHTMLDocType</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlenable">ProxyHTMLEnable</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlevents">ProxyHTMLEvents</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlextended">ProxyHTMLExtended</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlfixups">ProxyHTMLFixups</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlinterp">ProxyHTMLInterp</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmllinks">ProxyHTMLLinks</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmllogverbose">ProxyHTMLLogVerbose</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlstripcomments">ProxyHTMLStripComments</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#proxyhtmlurlmap">ProxyHTMLURLMap</a></li>
56 </ul>
57 </div>
58
59 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
60 <div class="directive-section"><h2><a name="ProxyHTMLBufSize" id="ProxyHTMLBufSize">ProxyHTMLBufSize</a> <a name="proxyhtmlbufsize" id="proxyhtmlbufsize">Directive</a></h2>
61 <table class="directive">
62 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the buffer size increment for buffering inline scripts and
63 stylesheets.</td></tr>
64 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLBufSize <var>bytes</var></code></td></tr>
65 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
66 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
67 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
68 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
69 for earlier 2.x versions</td></tr>
70 </table>
71 <p>In order to parse non-HTML content (stylesheets and scripts), mod_proxy_html
72 has to read the entire script or stylesheet into a buffer.  This buffer will
73 be expanded as necessary to hold the largest script or stylesheet in a page,
74 in increments of [nnnn] as set by this directive.</p>
75 <p>The default is 8192, and will work well for almost all pages.  However,
76 if you know you're proxying a lot of pages containing stylesheets and/or
77 scripts bigger than 8K (that is, for a single script or stylesheet,
78 NOT in total), it will be more efficient to set a larger buffer
79 size and avoid the need to resize the buffer dynamically during a request.
80 </p>
81
82 </div>
83 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
84 <div class="directive-section"><h2><a name="ProxyHTMLCharsetOut" id="ProxyHTMLCharsetOut">ProxyHTMLCharsetOut</a> <a name="proxyhtmlcharsetout" id="proxyhtmlcharsetout">Directive</a></h2>
85 <table class="directive">
86 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify a charset for mod_proxy_html output.</td></tr>
87 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLCharsetOut <var>Charset | *</var></code></td></tr>
88 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
89 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
90 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
91 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
92 for earlier 2.x versions</td></tr>
93 </table>
94 <p>This selects an encoding for mod_proxy_html output.  It should not
95 normally be used, as any change from the default <code>UTF-8</code>
96 (Unicode - as used internally by libxml2) will impose an additional
97 processing overhead.  The special token <code>ProxyHTMLCharsetOut *</code>
98 will generate output using the same encoding as the input.</p>
99 <p>Note that this relies on <code class="module"><a href="../mod/mod_xml2enc.html">mod_xml2enc</a></code> being loaded.</p>
100
101 </div>
102 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
103 <div class="directive-section"><h2><a name="ProxyHTMLDocType" id="ProxyHTMLDocType">ProxyHTMLDocType</a> <a name="proxyhtmldoctype" id="proxyhtmldoctype">Directive</a></h2>
104 <table class="directive">
105 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets an HTML or XHTML document type declaration.</td></tr>
106 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLDocType <var>HTML|XHTML [Legacy]</var><br /><strong>OR</strong>
107 <br />ProxyHTMLDocType <var>fpi [SGML|XML]</var></code></td></tr>
108 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
109 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
110 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
111 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
112 for earlier 2.x versions</td></tr>
113 </table>
114 <p>In the first form, documents will be declared as HTML 4.01 or XHTML 1.0
115 according to the option selected.  This option also determines whether
116 HTML or XHTML syntax is used for output.   Note that the format of the
117 documents coming from the backend server is immaterial: the parser will
118 deal with it automatically.  If the optional second argument is set to
119 "Legacy", documents will be declared "Transitional", an option that may
120 be necessary if you are proxying pre-1998 content or working with defective
121 authoring/publishing tools.</p>
122 <p>In the second form, it will insert your own FPI.  The optional second
123 argument determines whether SGML/HTML or XML/XHTML syntax will be used.</p>
124 <p>The default is changed to omitting any FPI,
125 on the grounds that no FPI is better than a bogus one.  If your backend
126 generates decent HTML or XHTML, set it accordingly.</p>
127 <p>If the first form is used, mod_proxy_html
128 will also clean up the HTML to the specified standard.  It cannot
129 fix every error, but it will strip out bogus elements and attributes.
130 It will also optionally log other errors at <code class="directive"><a href="../mod/mod_log_config.html#loglevel">LogLevel</a></code> Debug.</p>
131
132 </div>
133 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
134 <div class="directive-section"><h2><a name="ProxyHTMLEnable" id="ProxyHTMLEnable">ProxyHTMLEnable</a> <a name="proxyhtmlenable" id="proxyhtmlenable">Directive</a></h2>
135 <table class="directive">
136 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Turns the proxy_html filter on or off.</td></tr>
137 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLEnable <var>On|Off</var></code></td></tr>
138 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
139 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
140 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
141 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
142 module for earlier 2.x versions.</td></tr>
143 </table>
144     <p>A simple switch to enable or disable the proxy_html filter.
145     If <code class="module"><a href="../mod/mod_xml2enc.html">mod_xml2enc</a></code> is loaded it will also automatically
146     set up internationalisation support.</p>
147     <p>Note that the proxy_html filter will only act on HTML data
148     (Content-Type text/html or application/xhtml+xml) and when the
149     data are proxied.  You can override this (at your own risk) by
150     setting the <var>PROXY_HTML_FORCE</var> environment variable.</p>
151
152 </div>
153 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
154 <div class="directive-section"><h2><a name="ProxyHTMLEvents" id="ProxyHTMLEvents">ProxyHTMLEvents</a> <a name="proxyhtmlevents" id="proxyhtmlevents">Directive</a></h2>
155 <table class="directive">
156 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify attributes to treat as scripting events.</td></tr>
157 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLEvents <var>attribute [attribute ...]</var></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 for earlier 2.x versions</td></tr>
163 </table>
164 <p>Specifies one or more attributes to treat as scripting events and
165 apply <code class="directive">ProxyHTMLURLMap</code>s to where appropriate.
166 You can specify any number of attributes in one or more
167 <code>ProxyHTMLEvents</code> directives.</p>
168 <p>The default configuration defines the events in standard HTML 4
169 and XHTML 1.</p>
170
171 </div>
172 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
173 <div class="directive-section"><h2><a name="ProxyHTMLExtended" id="ProxyHTMLExtended">ProxyHTMLExtended</a> <a name="proxyhtmlextended" id="proxyhtmlextended">Directive</a></h2>
174 <table class="directive">
175 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether to fix links in inline scripts, stylesheets,
176 and scripting events.</td></tr>
177 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLExtended <var>On|Off</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>Set to <code>Off</code>, HTML links are rewritten according
185 <code class="directive">ProxyHTMLURLMap</code> directives, but links appearing
186 in Javascript and CSS are ignored.</p>
187 <p>Set to <code>On</code>, all scripting events and embedded scripts or
188 stylesheets are also processed by the <code class="directive">ProxyHTMLURLMap</code>
189 rules, according to the flags set for each rule.  Since this requires more
190 parsing, performance will be best if you only enable it when strictly necessary.</p>
191
192 </div>
193 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
194 <div class="directive-section"><h2><a name="ProxyHTMLFixups" id="ProxyHTMLFixups">ProxyHTMLFixups</a> <a name="proxyhtmlfixups" id="proxyhtmlfixups">Directive</a></h2>
195 <table class="directive">
196 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Fixes for simple HTML errors.</td></tr>
197 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLFixups <var>[lowercase] [dospath] [reset]</var></code></td></tr>
198 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
199 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
200 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
201 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
202 for earlier 2.x versions</td></tr>
203 </table>
204 <p>This directive takes one to three arguments as follows:</p>
205 <ul>
206 <li><code>lowercase</code> Urls are rewritten to lowercase</li>
207 <li><code>dospath</code> Backslashes in URLs are rewritten to forward slashes.</li>
208 <li><code>reset</code> Unset any options set at a higher level in the configuration.</li>
209 </ul>
210 <p>Take care when using these.  The fixes will correct certain authoring
211 mistakes, but risk also erroneously fixing links that were correct to start with.
212 Only use them if you know you have a broken backend server.</p> 
213
214 </div>
215 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
216 <div class="directive-section"><h2><a name="ProxyHTMLInterp" id="ProxyHTMLInterp">ProxyHTMLInterp</a> <a name="proxyhtmlinterp" id="proxyhtmlinterp">Directive</a></h2>
217 <table class="directive">
218 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables per-request interpolation of
219 <code class="directive">ProxyHTMLURLMap</code> rules.</td></tr>
220 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLInterp <var>On|Off</var></code></td></tr>
221 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
222 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
223 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
224 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
225 for earlier 2.x versions</td></tr>
226 </table>
227     <p>This enables per-request interpolation in
228     <code class="directive">ProxyHTMLURLMap</code> to- and from- patterns.</p>
229     <p>If interpolation is not enabled, all rules are pre-compiled at startup.
230     With interpolation, they must be re-compiled for every request, which
231     implies an extra processing overhead.  It should therefore be
232     enabled only when necessary.</p>
233
234 </div>
235 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
236 <div class="directive-section"><h2><a name="ProxyHTMLLinks" id="ProxyHTMLLinks">ProxyHTMLLinks</a> <a name="proxyhtmllinks" id="proxyhtmllinks">Directive</a></h2>
237 <table class="directive">
238 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify HTML elements that have URL attributes to be rewritten.</td></tr>
239 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLLinks <var>element attribute [attribute2 ...]</var></code></td></tr>
240 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
241 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
242 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
243 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
244 for earlier 2.x versions</td></tr>
245 </table>
246 <p>Specifies elements that have URL attributes that should be rewritten
247 using standard <code class="directive">ProxyHTMLURLMap</code>s.  You will need one
248 ProxyHTMLLinks directive per element, but it can have any number of attributes.</p>
249 <p>The default configuration defines the HTML links for standard HTML 4
250 and XHTML 1.</p>
251
252 </div>
253 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
254 <div class="directive-section"><h2><a name="ProxyHTMLLogVerbose" id="ProxyHTMLLogVerbose">ProxyHTMLLogVerbose</a> <a name="proxyhtmllogverbose" id="proxyhtmllogverbose">Directive</a></h2>
255 <table class="directive">
256 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables extra verbose logging for debug</td></tr>
257 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLLogVerbose <var>On|Off</var></code></td></tr>
258 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
259 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
260 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
261 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
262 for earlier 2.x versions</td></tr>
263 </table>
264 <p>If On, mod_proxy_html will log extra diagnostic information (at
265 <code class="directive"><a href="../mod/mod_log_config.html#loglevel">LogLevel</a></code> Info)
266 including charset detection and processing and
267 <code class="directive">ProxyHTMLURLMap</code> matches and rewrites.
268 This may be helpful in debugging a configuration.</p>
269
270 </div>
271 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
272 <div class="directive-section"><h2><a name="ProxyHTMLStripComments" id="ProxyHTMLStripComments">ProxyHTMLStripComments</a> <a name="proxyhtmlstripcomments" id="proxyhtmlstripcomments">Directive</a></h2>
273 <table class="directive">
274 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether to strip HTML comments.</td></tr>
275 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyHTMLStripComments <var>On|Off</var></code></td></tr>
276 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
277 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
278 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_html</td></tr>
279 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later; available as a third-party
280 for earlier 2.x versions</td></tr>
281 </table>
282 <p>This directive will cause mod_proxy_html to strip HTML comments.
283 Note that this will also kill off any scripts or styles embedded in
284 comments (a bogosity introduced in 1995/6 with Netscape 2 for the
285 benefit of then-older browsers, but still in use today).
286 It may also interfere with comment-based processors such as SSI or ESI:
287 be sure to run any of those <em>before</em> mod_proxy_html in the
288 filter chain if stripping comments!</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="ProxyHTMLURLMap" id="ProxyHTMLURLMap">ProxyHTMLURLMap</a> <a name="proxyhtmlurlmap" id="proxyhtmlurlmap">Directive</a></h2>
293 <table class="directive">
294 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Defines a rule to rewrite HTML links</td></tr>
295 <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>
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 module for earlier 2.x versions.</td></tr>
301 </table>
302 <p>This is the key directive for rewriting HTML links.  When parsing a document,
303 whenever a link target matches <var>from-pattern</var>, the matching
304 portion will be rewritten to <var>to-pattern</var>, as modified by any
305 flags supplied.</p>
306
307 <p>The optional third argument may define any of the following
308 <strong>Flags</strong>.  Flags are case-sensitive.</p>
309 <dl>
310 <dt>h</dt>
311 <dd><p>Ignore HTML links (pass through unchanged)</p></dd>
312 <dt>e</dt>
313 <dd><p>Ignore scripting events (pass through unchanged)</p></dd>
314 <dt>c</dt>
315 <dd><p>Pass embedded script and style sections through untouched.</p></dd>
316
317 <dt>L</dt>
318 <dd><p>Last-match.  If this rule matches, no more rules are applied
319 (note that this happens automatically for HTML links).</p></dd>
320 <dt>l</dt>
321 <dd><p>Opposite to L.  Overrides the one-change-only default
322 behaviour with HTML links.</p></dd>
323 <dt>R</dt>
324 <dd><p>Use Regular Expression matching-and-replace.  <code>from-pattern</code>
325 is a regexp, and <code>to-pattern</code> a replacement string that may be
326 based on the regexp.  Regexp memory is supported: you can use brackets ()
327 in the <code>from-pattern</code> and retrieve the matches with $1 to $9
328 in the <code>to-pattern</code>.</p>
329
330 <p>If R is not set, it will use string-literal search-and-replace.
331 The logic is <em>starts-with</em> in HTML links, but
332 <em>contains</em> in scripting events and embedded script and style sections.
333 </p>
334 </dd>
335 <dt>x</dt>
336 <dd><p>Use POSIX extended Regular Expressions.  Only applicable with R.</p></dd>
337 <dt>i</dt>
338 <dd><p>Case-insensitive matching.  Only applicable with R.</p></dd>
339
340 <dt>n</dt>
341 <dd><p>Disable regexp memory (for speed).  Only applicable with R.</p></dd>
342 <dt>s</dt>
343 <dd><p>Line-based regexp matching.  Only applicable with R.</p></dd>
344 <dt>^</dt>
345 <dd><p>Match at start only.  This applies only to string matching
346 (not regexps) and is irrelevant to HTML links.</p></dd>
347 <dt>$</dt>
348 <dd><p>Match at end only.  This applies only to string matching
349 (not regexps) and is irrelevant to HTML links.</p></dd>
350 <dt>V</dt>
351 <dd><p>Interpolate environment variables in <code>to-pattern</code>.
352 A string of the form <code>${varname|default}</code> will be replaced by the
353 value of environment variable <code>varname</code>.  If that is unset, it
354 is replaced by <code>default</code>.  The <code>|default</code> is optional.</p>
355 <p>NOTE: interpolation will only be enabled if
356 <code class="directive">ProxyHTMLInterp</code> is <var>On</var>.</p>
357 </dd>
358
359 <dt>v</dt>
360 <dd><p>Interpolate environment variables in <code>from-pattern</code>.
361 Patterns supported are as above.</p>
362 <p>NOTE: interpolation will only be enabled if
363 <code class="directive">ProxyHTMLInterp</code> is <var>On</var>.</p>
364 </dd>
365 </dl>
366
367
368 </div>
369 </div>
370 <div class="bottomlang">
371 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_html.html" title="English">&nbsp;en&nbsp;</a></p>
372 </div><div id="footer">
373 <p class="apache">Copyright 2011 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>
374 <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>
375 </body></html>