New upstream release (3.1.2)
[manu/mod-proxy-html.git] / faq.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html lang="en"><head>
4 <title>mod_proxy_html</title>
5 <style type="text/css">
6 @import url(/index.css) ;
7 </style>
8 </head><body>
9 <div id="apache">
10 <h1>mod_proxy_html: Frequently Asked Questions</h1>
11 <p>This answers some of the most frequently asked questions
12 that aren't dealt with (or that people overlook) in the documentation
13 and the apachetutor tutorial.  <span class="v3">This was written for
14 Version 2, and most of the questions are moot in Version 3.</span></p>
15 <h2>Questions</h2>
16 <ol>
17 <li><a href="#charset">Can mod_proxy_html support (charset XYZ) as input?</a></li>
18 <li><a href="#iconv">Can mod_proxy_html support (charset XYZ) as output?</a></li>
19 <li><a href="#script">Why does mod_proxy_html mangle my Javascript?</a></li>
20 <li><a href="#attr">Why doesn't mod_proxy_html rewrite urls in [some attribute]?</a></li>
21 </ol>
22 <h2>Answers</h2>
23 <dl>
24 <dt id="charset">Can mod_proxy_html support (charset XYZ) as input?</dt>
25 <dd><p>In version 2, that depends entirely on libxml2, and your charset
26 is supported if and only if libxml2 supports it.</p>
27 <p>In Version 3.1, charset support is much expanded provided
28 <a href="../mod_xml2enc/">mod_xml2enc</a> is enabled.  It is normally
29 sufficient just to load mod_xml2enc: it will be configured automatically
30 if you configure mod_proxy_html using <code>ProxyHTMLEnable</code>.
31 In a few cases, you may need to customise charset support further using
32 mod_xml2enc's directives.</p>
33 <p>Note that some servers send inconsistent and even conflicting charset
34 information, and may generate unexpected results.  Setting
35 <code>ProxyHTMLMeta On</code> may help resolve such cases, and will
36 help diagnose problems with extra debug information in the error log.</p>
37 </dd>
38 <dt id="iconv">Can mod_proxy_html support (charset XYZ) as output?</dt>
39 <dd><p>libxml2 uses <code>utf-8</code> internally for everything.
40 Generating output with another charset is therefore an additional
41 overhead, and the decision was taken to exclude any such capability
42 from mod_proxy_html.  There is an easy workaround: you can transcode
43 the output using another filter, such as mod_charset_lite.</p>
44 <p>mod_proxy_html 3 supports output transformation to other
45 charsets using <code>ProxyHTMLCharsetOut</code>.  This requires
46 mod_xml2enc to be loaded.</p>
47 </dd>
48 <dt id="script">Why does mod_proxy_html mangle my Javascript?</dt>
49 <dd><p>It doesn't.  Your javascript is simply too badly malformed,
50 and libxml2's error correction isn't what you expect!
51 Check it with <a href="http://valet.webthing.com/page/">a validator</a>,
52 or with libxml2's <tt>xmllint --html</tt>
53 (which uses the same parser as mod_proxy_html).  Here is
54 <a href="/mod_publisher/parser.html">a fuller explanation</a>.</p>
55 <p>The best fix for this is to remove the javascript from your markup,
56 and import it from a separate <tt>.js</tt> file.  If you have an
57 irredeemably broken publishing system, you may have to upgrade to
58 <a href="/mod_publisher/">mod_publisher</a> or resort to a markup-blind
59 filter such as <a href="/mod_line_edit/">mod_line_edit</a>,
60 mod_substitute or mod_sed.</p>
61 </dd>
62 <dt id="attr">Why doesn't mod_proxy_html rewrite urls in [some attribute]?</dt>
63 <dd><p>mod_proxy_html versions 1 and 2 are based on W3C HTML 4.01 and
64 XHTML 1.0 (which are identical in terms of elements and attributes).
65 It supports all links
66 defined in W3C HTML, even those that have been deprecated since 1997.
67 But it does <strong>NOT</strong> support proprietary pseudo-HTML "extensions"
68 that have never been part of <strong>any</strong> published HTML standard.
69 Of course, it's trivial to add them to the source.</p>
70 <p>This has been the most commonly requested feature since mod_proxy_html 2.0
71 was released in 2004.  Since everyone's requirements are different, it
72 could not reasonably be satisfied with a simple one-size-fits-all fix.
73 Version 3 of mod_proxy_html delegates the definition of HTML links to
74 the system administrator, via the configuration file.
75 <p>A sample file <tt>proxy_html.conf</tt> is provided, and defines
76 standard W3C HTML/XHTML.  Note that you MUST include this (or equivalent)
77 into your configuration, or no links will be rewritten!  If you need to
78 support nonstandard HTML variants, follow the instructions in
79 <tt>proxy_html.conf</tt>.</p>
80 </dd>
81 </dl>
82 </div>
83 <div id="navbar"><a class="internal" href="./" title="Up">Up</a>
84 *
85 <a class="internal" href="/" title="WebThing Apache Centre">Home</a>
86 *
87 <a class="internal" href="/contact.html" title="Contact WebThing">Contact</a>
88 *
89 <a class="external" href="http://www.webthing.com/" title="WebThing Ltd">Web&#222;ing</a>
90 *
91 <a class="external" href="http://www.apache.org/" title="Apache Software Foundation">Apache</a></div></body></html>