]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_include.xml
`build check-ja` :-)
[apache] / docs / manual / mod / mod_include.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4
5 <!--
6  Copyright 2002-2004 The Apache Software Foundation
7
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11
12      http://www.apache.org/licenses/LICENSE-2.0
13
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 -->
20
21 <modulesynopsis metafile="mod_include.xml.meta">
22
23 <name>mod_include</name>
24 <description>Server-parsed html documents (Server Side Includes)</description>
25 <status>Base</status>
26 <sourcefile>mod_include.c</sourcefile>
27 <identifier>include_module</identifier>
28 <compatibility>Implemented as an output filter since Apache
29 2.0</compatibility>
30
31 <summary>
32     <p>This module provides a filter which will process files
33     before they are sent to the client. The processing is
34     controlled by specially formatted SGML comments, referred to as
35     <dfn>elements</dfn>. These elements allow conditional text, the
36     inclusion of other files or programs, as well as the setting and
37     printing of environment variables.</p>
38 </summary>
39 <seealso><directive module="core">Options</directive></seealso>
40 <seealso><directive module="core">AcceptPathInfo</directive></seealso>
41 <seealso><a href="../filter.html">Filters</a></seealso>
42 <seealso><a href="../howto/ssi.html">SSI Tutorial</a></seealso>
43
44 <section id="enabling">
45     <title>Enabling Server-Side Includes</title>
46
47     <p>Server Side Includes are implemented by the
48     <code>INCLUDES</code> <a href="../filter.html">filter</a>. If
49     documents containing server-side include directives are given
50     the extension .shtml, the following directives will make Apache
51     parse them and assign the resulting document the mime type of
52     <code>text/html</code>:</p>
53
54     <example>
55       AddType text/html .shtml<br />
56       AddOutputFilter INCLUDES .shtml
57     </example>
58
59     <p>The following directive must be given for the directories
60     containing the shtml files (typically in a
61     <directive module="core" type="section">Directory</directive> section,
62     but this directive is also valid in <code>.htaccess</code> files if
63     <directive module="core">AllowOverride</directive> <code>Options</code>
64     is set):</p>
65
66     <example>
67       Options +Includes
68     </example>
69
70     <p>For backwards compatibility, the <code>server-parsed</code>
71     <a href="../handler.html">handler</a> also activates the
72     INCLUDES filter. As well, Apache will activate the INCLUDES
73     filter for any document with mime type
74     <code>text/x-server-parsed-html</code> or
75     <code>text/x-server-parsed-html3</code> (and the resulting
76     output will have the mime type <code>text/html</code>).</p>
77
78     <p>For more information, see our <a
79     href="../howto/ssi.html">Tutorial on Server Side Includes</a>.</p>
80 </section> <!-- /enabling -->
81
82 <section id="pathinfo">
83     <title>PATH_INFO with Server Side Includes</title>
84
85     <p>Files processed for server-side includes no longer accept
86     requests with <code>PATH_INFO</code> (trailing pathname information)
87     by default.  You can use the <directive
88     module="core">AcceptPathInfo</directive> directive to
89     configure the server to accept requests with <code>PATH_INFO</code>.</p>
90 </section> <!-- /pathinfo -->
91
92 <section id="elements"><title>Basic Elements</title>
93     <p>The document is parsed as an HTML document, with special
94     commands embedded as SGML comments. A command has the syntax: </p>
95
96     <example>
97       &lt;!--#<var>element</var> <var>attribute</var>=<var>value</var>
98       <var>attribute</var>=<var>value</var> ... --&gt;
99     </example>
100
101     <p>The value will often be enclosed in double quotes, but single
102     quotes (<code>'</code>) and backticks (<code>`</code>) are also
103     possible. Many commands only allow a single attribute-value pair.
104     Note that the comment terminator (<code>--&gt;</code>) should be
105     preceded by whitespace to ensure that it isn't considered part of
106     an SSI token. Note that the leading <code>&lt;!--#</code> is <em>one</em>
107     token and may not contain any whitespaces.</p>
108
109     <p>The allowed elements are listed in the following table:</p>
110
111     <table border="1">
112     <tr><th>Element</th><th>Description</th></tr>
113     <tr><td><code><a href="#element.config">config</a></code></td>
114         <td>configure output formats</td></tr>
115     <tr><td><code><a href="#element.echo">echo</a></code></td>
116         <td>print variables</td></tr>
117     <tr><td><code><a href="#element.exec">exec</a></code></td>
118         <td>execute external programs</td></tr>
119     <tr><td><code><a href="#element.fsize">fsize</a></code></td>
120         <td>print size of a file</td></tr>
121     <tr><td><code><a href="#element.flastmod">flastmod</a></code></td>
122         <td>print last modification time of a file</td></tr>
123     <tr><td><code><a href="#element.include">include</a></code></td>
124         <td>include a file</td></tr>
125     <tr><td><code><a href="#element.printenv">printenv</a></code></td>
126         <td>print all available variables</td></tr>
127     <tr><td><code><a href="#element.set">set</a></code></td>
128         <td>set a value of a variable</td></tr>
129     </table>
130
131     <p>SSI elements may be defined by modules other than
132     <module>mod_include</module>. In fact, the <code><a
133     href="#element.exec">exec</a></code> element is provided by
134     <module>mod_cgi</module>, and will only be available if this
135     module is loaded.</p>
136
137     <section id="element.config"><title>The config Element</title>
138       <p>This command controls various aspects of the parsing. The
139       valid attributes are:</p>
140
141       <dl>
142       <dt><code>echomsg</code> (<em>Apache 2.1 and later</em>)</dt>
143       <dd>The value is a message that is sent back to the
144       client if the <code><a href="#element.echo">echo</a></code> element
145       attempts to echo an undefined variable. This overrides any <directive
146       module="mod_include">SSIUndefinedEcho</directive> directives.</dd>
147
148       <dt><code>errmsg</code></dt>
149       <dd>The value is a message that is sent back to the
150       client if an error occurs while parsing the
151       document. This overrides any <directive
152       module="mod_include">SSIErrorMsg</directive> directives.</dd>
153
154       <dt><code>sizefmt</code></dt>
155       <dd>The value sets the format to be used which displaying
156       the size of a file. Valid values are <code>bytes</code>
157       for a count in bytes, or <code>abbrev</code> for a count
158       in Kb or Mb as appropriate, for example a size of 1024 bytes
159       will be printed as "1K".</dd>
160
161       <dt><code>timefmt</code></dt>
162       <dd>The value is a string to be used by the
163       <code>strftime(3)</code> library routine when printing
164       dates.</dd>
165       </dl>
166     </section> <!-- /config -->
167
168     <section id="element.echo"><title>The echo Element</title>
169       <p>This command prints one of the <a href="#includevars">include
170       variables</a>, defined below. If the variable is unset, the result is
171       determined by the <directive module="mod_include"
172       >SSIUndefinedEcho</directive> directive. Any dates printed are
173       subject to the currently configured <code>timefmt</code>.</p>
174
175       <p>Attributes:</p> 
176
177       <dl>
178       <dt><code>var</code></dt>
179       <dd>The value is the name of the variable to print.</dd>
180
181       <dt><code>encoding</code></dt>
182       <dd><p>Specifies how Apache should encode special characters
183       contained in the variable before outputting them. If set
184       to <code>none</code>, no encoding will be done. If set to
185       <code>url</code>, then URL encoding (also known as %-encoding;
186       this is appropriate for use within URLs in links, etc.) will be
187       performed. At the start of an <code>echo</code> element,
188       the default is set to <code>entity</code>, resulting in entity
189       encoding (which is appropriate in the context of a block-level
190       HTML element, <em>e.g.</em> a paragraph of text). This can be
191       changed by adding an <code>encoding</code> attribute, which will
192       remain in effect until the next <code>encoding</code> attribute
193       is encountered or the element ends, whichever comes first.</p>
194
195       <p>The <code>encoding</code> attribute must <em>precede</em> the
196       corresponding <code>var</code> attribute to be effective, and 
197       only special characters as defined in the ISO-8859-1 character
198       encoding will be encoded. This encoding process may not have the
199       desired result if a different character encoding is in use.</p>
200
201       <note type="warning">
202         In order to avoid cross-site scripting issues, you should
203         <em>always</em> encode user supplied data.
204       </note>
205       </dd>
206       </dl>
207     </section> <!-- /echo -->
208
209     <section id="element.exec"><title>The exec Element</title>
210       <p>The <code>exec</code> command executes a given shell command or
211       CGI script. It requires <module>mod_cgi</module> to be present
212       in the server. If <directive module="core">Options</directive>
213       <code>IncludesNOEXEC</code> is set, this command is completely
214       disabled. The valid attributes are:</p>
215
216       <dl>
217       <dt><code>cgi</code></dt>
218       <dd><p>The value specifies a (%-encoded) URL-path to
219       the CGI script. If the path does not begin with a slash (/),
220       then it is taken to be relative to the current
221       document. The document referenced by this path is
222       invoked as a CGI script, even if the server would not
223       normally recognize it as such. However, the directory
224       containing the script must be enabled for CGI scripts
225       (with <directive module="mod_alias">ScriptAlias</directive>
226       or <directive module="core">Options</directive>
227       <code>ExecCGI</code>).</p>
228
229       <p>The CGI script is given the <code>PATH_INFO</code> and query
230       string (<code>QUERY_STRING</code>) of the original request from the
231       client; these <em>cannot</em> be specified in the URL path. The
232       include variables will be available to the script in addition to
233       the standard <a href="mod_cgi.html">CGI</a> environment.</p>
234
235       <example><title>Example</title>
236         &lt;!--#exec cgi="/cgi-bin/example.cgi" --&gt;
237       </example>
238
239       <p>If the script returns a <code>Location:</code> header instead of
240       output, then this will be translated into an HTML anchor.</p>
241
242       <p>The <code><a href="#includevirtual">include virtual</a></code>
243       element should be used in preference to <code>exec cgi</code>. In
244       particular, if you need to pass additional arguments to a CGI program,
245       using the query string, this cannot be done with <code>exec
246       cgi</code>, but can be done with <code>include virtual</code>, as
247       shown here:</p>
248
249       <example>
250         &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
251       </example>
252       </dd>
253
254       <dt><code>cmd</code></dt>
255       <dd><p>The server will execute the given string using
256       <code>/bin/sh</code>. The <a href="#includevars"
257       >include variables</a> are available to the command, in addition
258       to the usual set of CGI variables.</p>
259
260       <p>The use of <code><a href="#includevirtual"
261       >#include virtual</a></code> is almost always prefered to using
262       either <code>#exec cgi</code> or <code>#exec cmd</code>. The former
263       (<code>#include virtual</code>) uses the standard Apache sub-request
264       mechanism to include files or scripts. It is much better tested and
265       maintained.</p>
266
267       <p>In addition, on some platforms, like Win32, and on unix when
268       using <a href="../suexec.html">suexec</a>, you cannot pass arguments
269       to a command in an <code>exec</code> directive, or otherwise include
270       spaces in the command. Thus, while the following will work under a
271       non-suexec configuration on unix, it will not produce the desired
272       result under Win32, or when running suexec:</p>
273
274       <example>
275         &lt;!--#exec cmd="perl /path/to/perlscript arg1 arg2" --&gt;
276       </example>
277       </dd>
278       </dl>
279     </section> <!-- /exec -->
280
281     <section id="element.fsize"><title>The fsize Element</title>
282       <p>This command prints the size of the specified file, subject
283       to the <code>sizefmt</code> format specification. Attributes:</p>
284
285       <dl>
286       <dt><code>file</code></dt>
287       <dd>The value is a path relative to the directory
288       containing the current document being parsed.</dd>
289
290       <dt><code>virtual</code></dt>
291       <dd>The value is a (%-encoded) URL-path. If it does not begin with
292       a slash (/) then it is taken to be relative to the current document.
293       Note, that this does <em>not</em> print the size of any CGI output,
294       but the size of the CGI script itself.</dd>
295       </dl>
296     </section> <!-- /fsize -->
297
298     <section id="element.flastmod"><title>The flastmod Element</title>
299       <p>This command prints the last modification date of the
300       specified file, subject to the <code>timefmt</code> format
301       specification. The attributes are the same as for the
302       <code><a href="#element.fsize">fsize</a></code> command.</p>
303     </section> <!-- /flastmod -->
304
305     <section id="element.include"><title>The include Element</title>
306       <p>This command inserts the text of another document or file
307       into the parsed file. Any included file is subject to the
308       usual access control. If the directory containing the
309       parsed file has <a href="core.html#options">Options</a>
310       <code>IncludesNOEXEC</code> set, then only documents with
311       a text MIME type (<code>text/plain</code>, <code>text/html</code>
312       etc.) will be included. Otherwise CGI scripts are invoked as normal
313       using the complete URL given in the command, including any query
314       string.</p>
315
316       <p>An attribute defines the location of the document; the
317       inclusion is done for each attribute given to the include
318       command. The valid attributes are:</p>
319
320       <dl>
321       <dt><code>file</code></dt>
322       <dd>The value is a path relative to the directory
323       containing the current document being parsed. It cannot
324       contain <code>../</code>, nor can it be an absolute path.
325       Therefore, you cannot include files that are outside of the
326       document root, or above the current document in the directory
327       structure. The <code>virtual</code> attribute should always be
328       used in preference to this one.</dd>
329
330       <dt><code><a id="includevirtual" name="includevirtual"
331       >virtual</a></code></dt>
332       <dd><p>The value is a (%-encoded) URL-path. The URL cannot contain a
333       scheme or hostname, only a path and an optional query string. If it
334       does not begin with a slash (/) then it is taken to be relative to the
335       current document.</p>
336
337       <p>A URL is constructed from the attribute, and the output the
338       server would return if the URL were accessed by the client is
339       included in the parsed output. Thus included files can be nested.</p>
340
341       <p>If the specified URL is a CGI program, the program will be
342       executed and its output inserted in place of the directive in the
343       parsed file. You may include a query string in a CGI url:</p>
344      
345       <example>
346         &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
347       </example>
348            
349       <p><code>include virtual</code> should be used in preference
350       to <code>exec cgi</code> to include the output of CGI programs
351       into an HTML document.</p>
352       </dd>
353       </dl>
354     </section> <!-- /include -->
355
356     <section id="element.printenv"><title>The printenv Element</title>
357       <p>This prints out a listing of all existing variables and
358       their values. Special characters are entity encoded (see the <code><a
359       href="#element.echo">echo</a></code> element for details)
360       before being output. There are no attributes.</p>
361
362       <example><title>Example</title>
363         &lt;!--#printenv --&gt;
364       </example>
365     </section> <!-- /printenv -->
366
367     <section id="element.set"><title>The set Element</title>
368       <p>This sets the value of a variable. Attributes:</p>
369
370       <dl>
371       <dt><code>var</code></dt>
372       <dd>The name of the variable to set.</dd>
373
374       <dt><code>value</code></dt>
375       <dd>The value to give a variable.</dd>
376       </dl>
377
378       <example><title>Example</title>
379         &lt;!--#set var="category" value="help" --&gt;
380       </example>
381     </section> <!-- /set -->
382 </section> <!-- /basic elements -->
383
384 <section id="includevars">
385     <title>Include Variables</title>
386
387     <p>In addition to the variables in the standard CGI environment,
388     these are available for the <code>echo</code> command, for
389     <code>if</code> and <code>elif</code>, and to any program
390     invoked by the document.</p>
391
392     <dl>
393       <dt><code>DATE_GMT</code></dt>
394       <dd>The current date in Greenwich Mean Time.</dd>
395
396       <dt><code>DATE_LOCAL</code></dt>
397       <dd>The current date in the local time zone.</dd>
398
399       <dt><code>DOCUMENT_NAME</code></dt>
400       <dd>The filename (excluding directories) of the document
401       requested by the user.</dd>
402
403       <dt><code>DOCUMENT_URI</code></dt>
404       <dd>The (%-decoded) URL path of the document requested by the
405       user. Note that in the case of nested include files, this is
406       <em>not</em> the URL for the current document.</dd>
407
408       <dt><code>LAST_MODIFIED</code></dt>
409       <dd>The last modification date of the document requested by
410       the user.</dd>
411
412       <dt><code>QUERY_STRING_UNESCAPED</code></dt>
413       <dd>If a query string is present, this variable contains the
414       (%-decoded) query string, which is <em>escaped</em> for shell
415       usage (special characters like <code>&amp;</code> etc. are
416       preceded by backslashes).</dd>
417     </dl>
418 </section>
419
420 <section id="substitution"><title>Variable Substitution</title>
421
422     <p>Variable substitution is done within quoted strings in most
423     cases where they may reasonably occur as an argument to an SSI
424     directive. This includes the <code>config</code>,
425     <code>exec</code>, <code>flastmod</code>, <code>fsize</code>,
426     <code>include</code>, <code>echo</code>, and <code>set</code>
427     directives, as well as the arguments to conditional operators.
428     You can insert a literal dollar sign into the string using backslash
429     quoting:</p>
430
431     <example>
432       &lt;!--#if expr="$a = \$test" --&gt;
433     </example>
434
435     <p>If a variable reference needs to be substituted in the
436     middle of a character sequence that might otherwise be
437     considered a valid identifier in its own right, it can be
438     disambiguated by enclosing the reference in braces,
439     <em>a la</em> shell substitution:</p>
440
441     <example>
442       &lt;!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" --&gt;
443     </example>
444
445     <p>This will result in the <code>Zed</code> variable being set
446     to "<code>X_Y</code>" if <code>REMOTE_HOST</code> is
447     "<code>X</code>" and <code>REQUEST_METHOD</code> is
448     "<code>Y</code>".</p>
449
450     <p>The below example will print "in foo" if the
451     <code>DOCUMENT_URI</code> is <code>/foo/file.html</code>, "in bar"
452     if it is <code>/bar/file.html</code> and "in neither" otherwise:</p>
453
454     <example>
455       &lt;!--#if expr='"$DOCUMENT_URI" = "/foo/file.html"' --&gt;<br />
456       <indent>
457         in foo<br />
458       </indent>
459       &lt;!--#elif expr='"$DOCUMENT_URI" = "/bar/file.html"' --&gt;<br />
460       <indent>
461         in bar<br />
462       </indent>
463       &lt;!--#else --&gt;<br />
464       <indent>
465         in neither<br />
466       </indent>
467       &lt;!--#endif --&gt;
468     </example>
469 </section>
470
471 <section id="flowctrl">
472     <title>Flow Control Elements</title>
473
474     <p>The basic flow control elements are:</p>
475
476     <example>
477       &lt;!--#if expr="<var>test_condition</var>" --&gt;<br />
478       &lt;!--#elif expr="<var>test_condition</var>" --&gt;<br />
479       &lt;!--#else --&gt;<br />
480       &lt;!--#endif --&gt;
481     </example>
482
483     <p>The <code>if</code> element works like an if statement in a
484     programming language. The test condition is evaluated and if
485     the result is true, then the text until the next <code>elif</code>,
486     <code>else</code> or <code>endif</code> element is included in the
487     output stream.</p>
488
489     <p>The <code>elif</code> or <code>else</code> statements are be used
490     to put text into the output stream if the original
491     <var>test_condition</var> was false. These elements are optional.</p>
492
493     <p>The <code>endif</code> element ends the <code>if</code> element
494     and is required.</p>
495
496     <p><var>test_condition</var> is one of the following:</p>
497
498     <dl>
499       <dt><code><var>string</var></code></dt>
500       <dd>true if <var>string</var> is not empty</dd>
501
502       <dt><code><var>string1</var> = <var>string2</var><br />
503       <var>string1</var> == <var>string2</var><br />
504       <var>string1</var> != <var>string2</var></code></dt>
505       
506       <dd><p>Compare <var>string1</var> with <var>string2</var>. If
507       <var>string2</var> has the form <code>/<var>string2</var>/</code>
508       then it is treated as a regular expression. Regular expressions are
509       implemented by the <a href="http://www.pcre.org">PCRE</a> engine and
510       have the same syntax as those in <a href="http://www.perl.com">perl
511       5</a>. Note that <code>==</code> is just an alias for <code>=</code>
512       and behaves exactly the same way.</p>
513
514       <p>If you are matching positive (<code>=</code> or <code>==</code>), you
515       can capture grouped parts of the regular expression. The captured parts
516       are stored in the special variables <code>$1</code> ..
517       <code>$9</code>.</p>
518
519       <example><title>Example</title>
520         &lt;!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" --&gt;<br />
521         <indent>
522           &lt;!--#set var="session" value="$1" --&gt;<br />
523         </indent>
524         &lt;!--#endif --&gt;
525       </example>
526       </dd>
527
528       <dt><code><var>string1</var> &lt; <var>string2</var><br />
529        <var>string1</var> &lt;= <var>string2</var><br />
530        <var>string1</var> &gt; <var>string2</var><br />
531        <var>string1</var> &gt;= <var>string2</var></code></dt>
532
533       <dd>Compare <var>string1</var> with <var>string2</var>. Note, that
534       strings are compared <em>literally</em> (using
535       <code>strcmp(3)</code>). Therefore the string "100" is less than
536       "20".</dd>
537
538       <dt><code>( <var>test_condition</var> )</code></dt>
539       <dd>true if <var>test_condition</var> is true</dd>
540
541       <dt><code>! <var>test_condition</var></code></dt>
542       <dd>true if <var>test_condition</var> is false</dd>
543
544       <dt><code><var>test_condition1</var> &amp;&amp;
545         <var>test_condition2</var></code></dt>
546       <dd>true if both <var>test_condition1</var> and
547       <var>test_condition2</var> are true</dd>
548
549       <dt><code><var>test_condition1</var> ||
550         <var>test_condition2</var></code></dt>
551       <dd>true if either <var>test_condition1</var> or
552       <var>test_condition2</var> is true</dd>
553     </dl>
554
555     <p>"<code>=</code>" and "<code>!=</code>" bind more tightly than
556     "<code>&amp;&amp;</code>" and "<code>||</code>". "<code>!</code>" binds
557     most tightly. Thus, the following are equivalent:</p>
558
559     <example>
560       &lt;!--#if expr="$a = test1 &amp;&amp; $b = test2" --&gt;<br />
561       &lt;!--#if expr="($a = test1) &amp;&amp; ($b = test2)" --&gt;
562     </example>
563
564     <p>The boolean operators <code>&amp;&amp;</code> and <code>||</code>
565     share the same priority. So if you want to bind such an operator more
566     tightly, you should use parentheses.</p>
567
568     <p>Anything that's not recognized as a variable or an operator
569     is treated as a string. Strings can also be quoted:
570     <code>'string'</code>. Unquoted strings can't contain whitespace
571     (blanks and tabs) because it is used to separate tokens such as
572     variables. If multiple strings are found in a row, they are
573     concatenated using blanks. So,</p>
574
575     <example>
576       <p><code><var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var
577       >string2</var></code> results in <code><var>string1</var>&nbsp;<var
578       >string2</var></code><br />
579       <br />
580       and<br />
581       <br />
582       <code>'<var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var
583       >string2</var>'</code> results in <code><var
584       >string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var>string2</var></code>.</p>
585     </example>
586
587     <note><title>Optimization of Boolean Expressions</title>
588       <p>If the expressions become more complex and slow down processing
589       significantly, you can try to optimize them according to the
590       evaluation rules:</p>
591       <ul>
592       <li>Expressions are evaluated from left to right</li>
593       <li>Binary boolean operators (<code>&amp;&amp;</code> and <code>||</code>)
594           are short circuited wherever possible. In conclusion with the rule
595           above that means, <module>mod_include</module> evaluates at first
596           the left expression. If the left result is sufficient to determine
597           the end result, processing stops here. Otherwise it evaluates the
598           right side and computes the end result from both left and right
599           results.</li>
600       <li>Short circuit evaluation is turned off as long as there are regular
601           expressions to deal with. These must be evaluated to fill in the
602           backreference variables (<code>$1</code> .. <code>$9</code>).</li>
603       </ul>
604       <p>If you want to look how a particular expression is handled, you can
605       recompile <module>mod_include</module> using the
606       <code>-DDEBUG_INCLUDE</code> compiler option. This inserts for every
607       parsed expression tokenizer information, the parse tree and how it is
608       evaluated into the output sent to the client.</p>
609     </note>
610 </section>
611
612 <directivesynopsis>
613 <name>SSIEndTag</name>
614 <description>String that ends an include element</description>
615 <syntax>SSIEndTag <var>tag</var></syntax>
616 <default>SSIEndTag &quot;--&gt;&quot;</default>
617 <contextlist><context>server config</context><context>virtual host</context>
618 </contextlist>
619 <compatibility>Available in version 2.0.30 and later.</compatibility>
620
621 <usage>
622     <p>This directive changes the string that <module>mod_include</module>
623     looks for to mark the end of an include element.</p>
624
625     <example><title>Example</title>
626       SSIEndTag "%&gt;"
627     </example>
628
629 </usage>
630 <seealso><directive module="mod_include">SSIStartTag</directive></seealso>
631 </directivesynopsis>
632
633 <directivesynopsis>
634 <name>SSIUndefinedEcho</name>
635 <description>String displayed when an unset variable is echoed</description>
636 <syntax>SSIUndefinedEcho <var>string</var></syntax>
637 <default>SSIUndefinedEcho &quot;(none)&quot;</default>
638 <contextlist><context>server config</context><context>virtual host</context>
639 <context>directory</context><context>.htaccess</context></contextlist>
640 <override>All</override>
641 <compatibility>Available in version 2.0.34 and later.</compatibility>
642
643 <usage>
644     <p>This directive changes the string that <module>mod_include</module>
645     displays when a variable is not set and &quot;echoed&quot;.</p>
646
647     <example><title>Example</title>
648       SSIUndefinedEcho "&lt;!-- undef --&gt;"
649     </example>
650 </usage>
651 </directivesynopsis>
652
653 <directivesynopsis>
654 <name>SSIErrorMsg</name>
655 <description>Error message displayed when there is an SSI
656 error</description>
657 <syntax>SSIErrorMsg <var>message</var></syntax>
658 <default>SSIErrorMsg &quot;[an error occurred while processing this
659 directive]&quot;</default>
660 <contextlist><context>server config</context><context>virtual host</context>
661 <context>directory</context><context>.htaccess</context></contextlist>
662 <override>All</override>
663 <compatibility>Available in version 2.0.30 and later.</compatibility>
664
665 <usage>
666     <p>The <directive>SSIErrorMsg</directive> directive changes the error
667     message displayed when <module>mod_include</module> encounters an
668     error. For production servers you may consider changing the default
669     error message to <code>&quot;&lt;!-- Error --&gt;&quot;</code> so that
670     the message is not presented to the user.</p>
671
672     <p>This directive has the same effect as the <code>&lt;!--#config
673     errmsg=<var>message</var> --&gt;</code> element.</p>
674
675     <example><title>Example</title>
676       SSIErrorMsg "&lt;!-- Error --&gt;"
677     </example>
678 </usage>
679 </directivesynopsis>
680
681 <directivesynopsis>
682 <name>SSIStartTag</name>
683 <description>String that starts an include element</description>
684 <syntax>SSIStartTag <var>tag</var></syntax>
685 <default>SSIStartTag &quot;&lt;!--#&quot;</default>
686 <contextlist><context>server config</context><context>virtual host</context>
687 </contextlist>
688 <compatibility>Available in version 2.0.30 and later.</compatibility>
689
690 <usage>
691     <p>This directive changes the string that <module>mod_include</module>
692     looks for to mark an include element to process.</p>
693
694     <p>You may want to use this option if you have 2 servers parsing the
695     output of a file each processing different commands (possibly at
696     different times).</p> 
697
698     <example><title>Example</title>
699       SSIStartTag "&lt;%"
700     </example>
701
702     <p>The example given above, in conjunction with a matching
703     <directive module="mod_include">SSIEndTag</directive>, will 
704     allow you to use SSI directives as shown in the example 
705     below:</p>
706
707     <example><title>SSI directives with alternate start and end tags</title>
708       &lt;%printenv %&gt;
709     </example>
710 </usage>
711 <seealso><directive module="mod_include">SSIEndTag</directive></seealso>
712 </directivesynopsis>
713
714 <directivesynopsis>
715 <name>SSITimeFormat</name>
716 <description>Configures the format in which date strings are
717 displayed</description>
718 <syntax>SSITimeFormat <var>formatstring</var></syntax>
719 <default>SSITimeFormat &quot;%A, %d-%b-%Y %H:%M:%S %Z&quot;</default>
720 <contextlist>
721 <context>server config</context><context>virtual host</context>
722 <context>directory</context><context>.htaccess</context></contextlist>
723 <override>All</override>
724 <compatibility>Available in version 2.0.30 and later.</compatibility>
725
726 <usage>
727 <p>This directive changes the format in which date strings are displayed 
728     when echoing <code>DATE</code> environment variables. The
729     <var>formatstring</var> is as in <code>strftime(3)</code> from the
730     C standard library.</p>
731
732     <p>This directive has the same effect as the <code>&lt;!--#config
733     timefmt=<var>formatstring</var> --&gt;</code> element.</p>
734
735     <example><title>Example</title>
736       SSITimeFormat "%R, %B %d, %Y"
737     </example>
738
739     <p>The above directive would cause times to be displayed in the
740     format "22:26, June 14, 2002".</p>
741 </usage>
742 </directivesynopsis>
743
744 <directivesynopsis>
745 <name>XBitHack</name>
746 <description>Parse SSI directives in files with the execute bit
747 set</description>
748 <syntax>XBitHack on|off|full</syntax>
749 <default>XBitHack off</default>
750 <contextlist><context>server config</context><context>virtual host</context>
751 <context>directory</context><context>.htaccess</context></contextlist>
752 <override>Options</override>
753
754 <usage>
755     <p>The <directive>XBitHack</directive> directive controls the parsing
756     of ordinary html documents. This directive only affects files associated
757     with the MIME type <code>text/html</code>. <directive
758     >XBitHack</directive> can take on the following values:</p>
759
760     <dl>
761       <dt><code>off</code></dt>
762       <dd>No special treatment of executable files.</dd>
763
764       <dt><code>on</code></dt>
765       <dd>Any <code>text/html</code> file that has the user-execute bit
766       set will be treated as a server-parsed html document.</dd>
767
768       <dt><code>full</code></dt>
769       <dd>As for <code>on</code> but also test the group-execute bit.
770       If it is set, then set the <code>Last-modified</code> date of the
771       returned file to be the last modified time of the file. If
772       it is not set, then no last-modified date is sent. Setting
773       this bit allows clients and proxies to cache the result of
774       the request. 
775
776       <note><title>Note</title>
777       <p>You would not want to use the full option, unless you assure the
778       group-execute bit is unset for every SSI script which might <code
779       >#include</code> a CGI or otherwise produces different output on
780       each hit (or could potentially change on subsequent requests).</p>
781       </note>
782       </dd>
783     </dl>
784
785     </usage>
786 </directivesynopsis>
787
788 </modulesynopsis>
789