]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_include.html
113a44f4ca9f7a1c60aaa35c432222006061c918
[apache] / docs / manual / mod / mod_include.html
1 <html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3      This file is generated from xml source: DO NOT EDIT
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 --><title>mod_include - Apache HTTP Server</title><link href="../style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img alt="[APACHE DOCUMENTATION]" src="../images/sub.gif"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_include</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td><description>Server-parsed html documents (Server Side Includes)</description></td></tr><tr><td><a href="module-dict.html#Status" class="help">Status:</a></td><td>Base</td></tr><tr><td><a href="module-dict.html#ModuleIdentifier" class="help">Module&nbsp;Identifier:</a></td><td>include_module</td></tr></table></td></tr></table><h2>Summary</h2><summary>
6
7     <p>This module provides a filter which will process files
8     before they are sent to the client. The processing is
9     controlled by specially formated SGML comments, referred to as
10     <em>elements</em>. These elements allow conditional text, the
11     inclusion other files or programs, as well as the setting and
12     printing of environment variables.</p>
13
14 </summary><p><strong>See also </strong></p><ul><li><a href="core.html#options" class="directive"><code class="directive">Options</code></a></li><li><a href="core.html#setoutputfilter" class="directive"><code class="directive">SetOutputFilter</code></a></li><li><a href="core.html#acceptpathinfo" class="directive"><code class="directive">AcceptPathInfo</code></a></li></ul><h2>Directives</h2><ul><li><a href="#ssiendtag">SSIEndTag</a></li><li><a href="#ssierrormsg">SSIErrorMsg</a></li><li><a href="#ssistarttag">SSIStartTag</a></li><li><a href="#ssitimeformat">SSITimeFormat</a></li><li><a href="#ssiundefinedecho">SSIUndefinedEcho</a></li><li><a href="#xbithack">XBitHack</a></li></ul><h2><a name="enabling">Enabling Server-Side Includes</a></h2>
15     
16
17     <p>Server Side Includes are implemented by the
18     <code>INCLUDES</code> <a href="../filter.html">filter</a>. If
19     documents containing server-side include directives are given
20     the extension .shtml, the following directives will make Apache
21     parse them and assign the resulting document the mime type of
22     <code>text/html</code>:</p>
23
24     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
25       AddType text/html .shtml<br>
26       AddOutputFilter INCLUDES .shtml
27     </code></td></tr></table></blockquote>
28
29     <p>The following directive must be given for the directories
30     containing the shtml files (typically in a
31     <code>&lt;Directory&gt;</code> section, but this directive is
32     also valid .htaccess files if <code>AllowOverride
33     Options</code> is set):</p>
34
35     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
36       Options +Includes
37     </code></td></tr></table></blockquote>
38
39     <p>For backwards compatibility, the <code>server-parsed</code>
40     <a href="../handler.html">handler</a> also activates the
41     INCLUDES filter. As well, Apache will activate the INCLUDES
42     filter for any document with mime type
43     <code>text/x-server-parsed-html</code> or
44     <code>text/x-server-parsed-html3</code> (and the resulting
45     output will have the mime type <code>text/html</code>).</p>
46
47     <p>For more information, see our <a href="../howto/ssi.html">Tutorial on Server Side
48     Includes</a>.</p>
49 <h2><a name="basic">Basic Elements</a></h2>
50     
51     <p>The document is parsed as an HTML document, with special
52     commands embedded as SGML comments. A command has the syntax: </p>
53
54     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
55       <code>&lt;!--#</code><em>element attribute=value
56       attribute=value ...</em> <code>--&gt;</code>
57     </code></td></tr></table></blockquote>
58
59     <p>The value will often be enclosed in double quotes; many
60     commands only allow a single attribute-value pair. Note that
61     the comment terminator (<code>--&gt;</code>) should be preceded
62     by whitespace to ensure that it isn't considered part of an SSI
63     token. </p>
64
65     <p>The allowed elements are:</p>
66
67     <dl>
68       <dt><strong>config</strong></dt>
69
70       <dd>
71         This command controls various aspects of the parsing. The
72         valid attributes are: 
73
74         <dl>
75           <dt><strong>errmsg</strong></dt>
76
77           <dd>The value is a message that is sent back to the
78           client if an error occurs whilst parsing the
79           document.</dd>
80
81           <dt><strong>sizefmt</strong></dt>
82
83           <dd>The value sets the format to be used which displaying
84           the size of a file. Valid values are <code>bytes</code>
85           for a count in bytes, or <code>abbrev</code> for a count
86           in Kb or Mb as appropriate.</dd>
87
88           <dt><strong>timefmt</strong></dt>
89
90           <dd>The value is a string to be used by the
91           <code>strftime(3)</code> library routine when printing
92           dates.</dd>
93         </dl>
94       </dd>
95
96       <dt><strong><a name="echo">echo</a></strong></dt>
97
98       <dd>
99         <p>This command prints one of the <a href="#includevars">include
100         variables</a>, defined below. If the variable is unset, it
101         is printed as <code>(none)</code>. Any dates printed are
102         subject to the currently configured <code>timefmt</code>.</p>
103
104         <p>Attributes:</p> 
105
106         <dl>
107           <dt><strong>var</strong></dt>
108
109           <dd>The value is the name of the variable to print.</dd>
110
111           <dt><strong>encoding</strong></dt>
112
113           <dd>Specifies how Apache should encode special characters
114           contained in the variable before outputting them. If set
115           to "none", no encoding will be done. If set to "url",
116           then URL encoding (also known as %-encoding; this is
117           appropriate for use within URLs in links, etc.) will be
118           performed. At the start of an <code>echo</code> element,
119           the default is set to "entity", resulting in entity
120           encoding (which is appropriate in the context of a
121           block-level HTML element, eg. a paragraph of text). This
122           can be changed by adding an <code>encoding</code>
123           attribute, which will remain in effect until the next
124           <code>encoding</code> attribute is encountered or the
125           element ends, whichever comes first. Note that the
126           <code>encoding</code> attribute must <em>precede</em> the
127           corresponding <code>var</code> attribute to be effective,
128           and that only special characters as defined in the
129           ISO-8859-1 character encoding will be encoded. This
130           encoding process may not have the desired result if a
131           different character encoding is in use. Apache 1.3.12 and
132           above; previous versions do no encoding.</dd>
133         </dl>
134       </dd>
135
136       <dt><strong>exec</strong></dt>
137
138       <dd>
139         The exec command executes a given shell command or CGI
140         script. The IncludesNOEXEC <a href="core.html#option" class="directive"><code class="directive">Option</code></a> disables this command
141         completely. The valid attributes are: 
142
143         <dl>
144           <dt><strong>cgi</strong></dt>
145
146           <dd>
147             The value specifies a (%-encoded) URL relative path to
148             the CGI script. If the path does not begin with a (/),
149             then it is taken to be relative to the current
150             document. The document referenced by this path is
151             invoked as a CGI script, even if the server would not
152             normally recognize it as such. However, the directory
153             containing the script must be enabled for CGI scripts
154             (with <a href="mod_alias.html#scriptalias" class="directive"><code class="directive">ScriptAlias</code></a>
155             or the ExecCGI <a href="core.html#option" class="directive"><code class="directive">Option</code></a>). 
156
157             <p>The CGI script is given the PATH_INFO and query
158             string (QUERY_STRING) of the original request from the
159             client; these cannot be specified in the URL path. The
160             include variables will be available to the script in
161             addition to the standard <a href="mod_cgi.html">CGI</a>
162             environment.</p>
163
164             <p>For example:</p>
165
166   <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>&lt;!--#exec cgi="/cgi-bin/example.cgi" --&gt;</code></td></tr></table></blockquote>
167
168             <p>If the script returns a Location: header instead of
169             output, then this will be translated into an HTML
170             anchor.</p>
171
172             <p>The <code><a href="#includevirtual">include
173             virtual</a></code> element should be
174             used in preference to <code>exec cgi</code>. In particular,
175             if you need to pass additional arguments to a CGI program,
176             using the query string, this cannot be done with <code>exec
177             cgi</code>, but can be done with <code>include
178             virtual</code>, as shown here:</p>
179
180   <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
181   &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
182   </code></td></tr></table></blockquote>
183
184           </dd>
185
186           <dt><strong>cmd</strong></dt>
187
188           <dd>
189           <p>The server will execute the given string using
190           <code>/bin/sh</code>. The <a href="#includevars">include variables</a> are available
191           to the command, in addition to the usual set of CGI 
192           variables.</p>
193
194         <p>The use of <code><a href="#includevirtual">#include 
195         virtual</a></code> is almost always
196         prefered to using either <code>#exec cgi</code> or <code>#exec
197         cmd</code>. The former (<code>#include virtual</code>) used the
198         standard Apache sub-request mechanism to include files or
199         scripts. It is much better tested and maintained.</p>
200
201           <p>In addition, on some platforms, like Win32, and on unix
202           when using suexec, you cannot pass arguments to a command in 
203           an <code>exec</code> directive, or otherwise include spaces in
204           the command. Thus, while the following will work under a
205           non-suexec configuration on unix, it will not produce the
206           desired result under Win32, or when running suexec:</p>
207
208    <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
209    &lt;!--#exec cmd="perl /path/to/perlscript arg1 arg2" --&gt;
210    </code></td></tr></table></blockquote>
211
212           </dd>
213         </dl>
214       </dd>
215
216       <dt><strong>fsize</strong></dt>
217
218       <dd>
219         This command prints the size of the specified file, subject
220         to the <code>sizefmt</code> format specification.
221         Attributes: 
222
223         <dl>
224           <dt><strong>file</strong></dt>
225
226           <dd>The value is a path relative to the directory
227           containing the current document being parsed.</dd>
228
229           <dt><strong>virtual</strong></dt>
230
231           <dd>The value is a (%-encoded) URL-path relative to the
232           current document being parsed. If it does not begin with
233           a slash (/) then it is taken to be relative to the
234           current document.</dd>
235         </dl>
236       </dd>
237
238       <dt><strong>flastmod</strong></dt>
239
240       <dd>This command prints the last modification date of the
241       specified file, subject to the <code>timefmt</code> format
242       specification. The attributes are the same as for the
243       <code>fsize</code> command.</dd>
244
245       <dt><strong>include</strong></dt>
246
247       <dd>
248         This command inserts the text of another document or file
249         into the parsed file. Any included file is subject to the
250         usual access control. If the directory containing the
251         parsed file has the <a href="core.html#options">Option</a>
252         IncludesNOEXEC set, and the including the document would
253         cause a program to be executed, then it will not be
254         included; this prevents the execution of CGI scripts.
255         Otherwise CGI scripts are invoked as normal using the
256         complete URL given in the command, including any query
257         string. 
258
259         <p>An attribute defines the location of the document; the
260         inclusion is done for each attribute given to the include
261         command. The valid attributes are:</p>
262
263         <dl>
264           <dt><strong>file</strong></dt>
265
266           <dd>The value is a path relative to the directory
267           containing the current document being parsed. It cannot
268           contain <code>../</code>, nor can it be an absolute path.
269           Therefore, you cannot include files that are outside of the
270           document root, or above the current document in the directory
271           structure.
272           The <code>virtual</code> attribute should always be used
273           in preference to this one.</dd>
274
275           <dt><strong><a name="includevirtual">virtual</a></strong></dt>
276
277          <dd>
278           <p>The value is a (%-encoded) URL relative to the
279           current document being parsed. The URL cannot contain a
280           scheme or hostname, only a path and an optional query
281           string. If it does not begin with a slash (/) then it is
282           taken to be relative to the current document.</p>
283
284           <p>A URL is constructed from the attribute, and the output the
285         server would return if the URL were accessed by the client
286         is included in the parsed output. Thus included files can
287            be nested.</p>
288
289            <p>If the specified URL is a CGI program, the program will
290            be executed and its output inserted in place of the directive
291            in the parsed file. You may include a query string in a CGI
292            url:</p>
293      
294      <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
295      &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
296      </code></td></tr></table></blockquote>
297            
298            <p><code>include virtual</code> should be used in preference
299            to <code>exec cgi</code> to include the output of CGI
300            programs into an HTML document.</p>
301           </dd>
302         </dl>
303       </dd>
304
305       <dt><strong>printenv</strong></dt>
306
307       <dd>
308       <p>This prints out a listing of all existing variables and
309       their values. Starting with Apache 1.3.12, special characters
310       are entity encoded (see the <a href="#echo"><code>echo</code></a> element for details)
311       before being output. There are no attributes.</p>
312
313       <p>For example:</p>
314
315       <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
316       &lt;!--#printenv --&gt;
317       </code></td></tr></table></blockquote>
318
319       <p>The <strong>printenv</strong> element is available only in
320       Apache 1.2 and above.</p>
321     </dd>
322       <dt><strong>set</strong></dt>
323
324       <dd>
325         This sets the value of a variable. Attributes: 
326
327         <dl>
328           <dt><strong>var</strong></dt>
329
330           <dd>The name of the variable to set.</dd>
331
332           <dt><strong>value</strong></dt>
333
334           <dd>The value to give a variable.</dd>
335         </dl>
336         <p>For example:</p>
337         
338         <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
339         &lt;!--#set var="category" value="help" --&gt;
340         </code></td></tr></table></blockquote>
341
342       <p>The <strong>set</strong> element is available only in
343       Apache 1.2 and above.</p>
344       </dd>
345     </dl>
346 <h2><a name="includevars">Include Variables</a></h2>
347     
348
349     <p>In addition to the variables in the standard CGI environment,
350     these are available for the <code>echo</code> command, for
351     <code>if</code> and <code>elif</code>, and to any program
352     invoked by the document.</p>
353
354     <dl>
355       <dt>DATE_GMT</dt>
356
357       <dd>The current date in Greenwich Mean Time.</dd>
358
359       <dt>DATE_LOCAL</dt>
360
361       <dd>The current date in the local time zone.</dd>
362
363       <dt>DOCUMENT_NAME</dt>
364
365       <dd>The filename (excluding directories) of the document
366       requested by the user.</dd>
367
368       <dt>DOCUMENT_URI</dt>
369
370       <dd>The (%-decoded) URL path of the document requested by the
371       user. Note that in the case of nested include files, this is
372       <em>not</em> then URL for the current document.</dd>
373
374       <dt>LAST_MODIFIED</dt>
375
376       <dd>The last modification date of the document requested by
377       the user.</dd>
378     </dl>
379 <h2>Variable Substitution</h2>
380     
381
382     <p>Variable substitution is done within quoted strings in most
383     cases where they may reasonably occur as an argument to an SSI
384     directive. This includes the <code>config</code>,
385     <code>exec</code>, <code>flastmod</code>, <code>fsize</code>,
386     <code>include</code>, and <code>set</code> directives, as well
387     as the arguments to conditional operators. You can insert a
388     literal dollar sign into the string using backslash
389     quoting:</p>
390 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
391     &lt;!--#if expr="$a = \$test" --&gt;
392 </code></td></tr></table></blockquote>
393
394     <p>If a variable reference needs to be substituted in the
395     middle of a character sequence that might otherwise be
396     considered a valid identifier in its own right, it can be
397     disambiguated by enclosing the reference in braces,
398     <em>a la</em> shell substitution:</p>
399
400 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
401     &lt;!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" --&gt;
402 </code></td></tr></table></blockquote>
403
404     <p>This will result in the <code>Zed</code> variable being set
405     to "<code>X_Y</code>" if <code>REMOTE_HOST</code> is
406     "<code>X</code>" and <code>REQUEST_METHOD</code> is
407     "<code>Y</code>".</p>
408
409     <p>EXAMPLE: the below example will print "in foo" if the
410     DOCUMENT_URI is /foo/file.html, "in bar" if it is
411     /bar/file.html and "in neither" otherwise:</p>
412
413 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
414     &lt;!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\"" --&gt;<br>
415     in foo<br>
416     &lt;!--#elif expr="\"$DOCUMENT_URI\" = \"/bar/file.html\"" --&gt;<br>
417     in bar<br>
418     &lt;!--#else --&gt;<br>
419     in neither<br>
420     &lt;!--#endif --&gt;
421 </code></td></tr></table></blockquote>
422 <h2><a name="flowctrl">Flow Control Elements</a></h2>
423     
424
425     <p>These are available in Apache 1.2 and above. The basic flow
426     control elements are:</p>
427
428 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
429     &lt;!--#if expr="<em>test_condition</em>" --&gt;<br>
430     &lt;!--#elif expr="<em>test_condition</em>" --&gt;<br>
431     &lt;!--#else --&gt;<br>
432     &lt;!--#endif --&gt;
433 </code></td></tr></table></blockquote>
434
435     <p>The <strong><code>if</code></strong> element works like an
436     if statement in a programming language. The test condition is
437     evaluated and if the result is true, then the text until the
438     next <strong><code>elif</code></strong>,
439     <strong><code>else</code></strong>. or
440     <strong><code>endif</code></strong> element is included in the
441     output stream.</p>
442
443     <p>The <strong><code>elif</code></strong> or
444     <strong><code>else</code></strong> statements are be used the
445     put text into the output stream if the original test_condition
446     was false. These elements are optional.</p>
447
448     <p>The <strong><code>endif</code></strong> element ends the
449     <strong><code>if</code></strong> element and is required.</p>
450
451     <p><em>test_condition</em> is one of the following:</p>
452
453     <dl>
454       <dt><em>string</em></dt>
455
456       <dd>true if <em>string</em> is not empty</dd>
457
458       <dt><em>string1</em> = <em>string2</em><br>
459        <em>string1</em> != <em>string2</em><br>
460        <em>string1</em> &lt; <em>string2</em><br>
461        <em>string1</em> &lt;= <em>string2</em><br>
462        <em>string1</em> &gt; <em>string2</em><br>
463        <em>string1</em> &gt;= <em>string2</em></dt>
464
465       <dd>Compare string1 with string 2. If string2 has the form
466       <em>/string/</em> then it is compared as a regular
467       expression. Regular expressions have the same syntax as those
468       found in the Unix <code>egrep</code> command.</dd>
469
470       <dt>( <em>test_condition</em> )</dt>
471
472       <dd>true if <em>test_condition</em> is true</dd>
473
474       <dt>! <em>test_condition</em></dt>
475
476       <dd>true if <em>test_condition</em> is false</dd>
477
478       <dt><em>test_condition1</em> &amp;&amp;
479       <em>test_condition2</em></dt>
480
481       <dd>true if both <em>test_condition1</em> and
482       <em>test_condition2</em> are true</dd>
483
484       <dt><em>test_condition1</em> || <em>test_condition2</em></dt>
485
486       <dd>true if either <em>test_condition1</em> or
487       <em>test_condition2</em> is true</dd>
488     </dl>
489
490     <p>"<em>=</em>" and "<em>!=</em>" bind more tightly than
491     "<em>&amp;&amp;</em>" and "<em>||</em>". "<em>!</em>" binds
492     most tightly. Thus, the following are equivalent:</p>
493
494 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
495     &lt;!--#if expr="$a = test1 &amp;&amp; $b = test2" --&gt;<br>
496     &lt;!--#if expr="($a = test1) &amp;&amp; ($b = test2)" --&gt;
497 </code></td></tr></table></blockquote>
498
499     <p>Anything that's not recognized as a variable or an operator
500     is treated as a string. Strings can also be quoted:
501     <em>'string'</em>. Unquoted strings can't contain whitespace
502     (blanks and tabs) because it is used to separate tokens such as
503     variables. If multiple strings are found in a row, they are
504     concatenated using blanks. So,</p>
505
506 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
507     <pre><em>string1    string2</em>  results in <em>string1 string2</em></pre>
508     <pre><em>'string1    string2'</em> results in <em>string1    string2</em></pre>
509 </code></td></tr></table></blockquote>
510
511 <h2>Using Server Side Includes for ErrorDocuments</h2>
512     
513
514     <p>There is <a href="../misc/custom_errordocs.html">a document</a>
515     which describes how to use the features of mod_include to offer
516     internationalized customized server error documents.</p>
517
518 <h2>PATH_INFO with Server Side Includes</h2>
519
520     <p>Files processed for server-side includes no longer accept
521     requests with PATH_INFO (trailing pathname information) by
522     default.  You can use the <a href="code.html#acceptpathinfo" class="directive"><code class="directive">AcceptPathInfo</code></a> directive to
523     configure the server to accept requests with PATH_INFO.</p>
524
525 <hr/><h2><a name="SSIEndTag">SSIEndTag</a> <a name="ssiendtag">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Changes the string that mod_include looks for to end an
526 include command.</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>SSIEndTag <em>tag</em></syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>SSIEndTag "--&gt;"</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>FileInfo</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_include</td></tr><tr><td align="left" valign="top"><a href="directive-dict.html#Compatibility" class="help">Compatibility:</a></td><td>Apache 1.2 and Available in version 2.0.30 and later.
527 </td></tr></table></td></tr></table><usage>
528     <p>This directive changes the string that mod_include looks for 
529     to mark the end of a include command.</p>
530
531 </usage><p><strong>See also </strong></p><ul><li><code class="directive">SSIStartTag</code></li></ul><hr/><h2><a name="SSIErrorMsg">SSIErrorMsg</a> <a name="ssierrormsg">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Changes the error message displayed when there is an error</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>SSIErrorMsg <em>message</em></syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>SSIErrorMsg 
532 "[an error occurred while processing this directive]"</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td/></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_include</td></tr><tr><td align="left" valign="top"><a href="directive-dict.html#Compatibility" class="help">Compatibility:</a></td><td>Available in version 2.0.30 and later.</td></tr></table></td></tr></table><usage>
533     <p>The SSIErrorMsg directive changes the error message displayed
534     when mod_include encounters an error. For production servers you
535     may consider changing the default error message to
536     <code>"&lt;-- Error --&gt;"</code> so that the message
537     is not presented to the user.
538     </p>
539     <p>This directive has the same effect as the <code>&lt;--#config
540     errmsg=<em>message</em> --&gt;</code> element.</p>
541
542 </usage><hr/><h2><a name="SSIStartTag">SSIStartTag</a> <a name="ssistarttag">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>Changes the string that mod_include looks for to start an
543 include element</syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>SSIStartTag "&lt;--!"</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td/></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_include</td></tr><tr><td align="left" valign="top"><a href="directive-dict.html#Compatibility" class="help">Compatibility:</a></td><td>Available in version 2.0.30 and later.</td></tr></table></td></tr></table><usage>
544
545     <p>This directive changes the string that mod_include looks for 
546     to mark an include element to process.</p>
547
548     <p>You may want to use this option if have 2 servers parsing the
549     output of a file each processing different commands (possibly at
550     different times).</p> 
551
552 </usage><p><strong>See also </strong></p><ul><li><code class="directive">SSIEndTag</code></li></ul><hr/><h2><a name="SSITimeFormat">SSITimeFormat</a> <a name="ssitimeformat">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Configures the format in which date strings are 
553 displayed</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>SSITimeFormat <em>formatstring</em></syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>SSITimeFormat "%A, %d-%b-%Y %H:%M:%S %Z"</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td/></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_include</td></tr><tr><td align="left" valign="top"><a href="directive-dict.html#Compatibility" class="help">Compatibility:</a></td><td>Available in version 2.0.30 and later.</td></tr></table></td></tr></table><usage>
554 <p>This directive changes the format in which date strings are displayed 
555     when echoing DATE environment variables.  The <em>formatstring</em>
556     is as in strftime(3) from the C standard library.</p>
557
558     <p>This directive has the same effect as the <code>&lt;--#config
559     timefmt=<em>formatstring</em> --&gt;</code> element.</p>
560 </usage><hr/><h2><a name="SSIUndefinedEcho">SSIUndefinedEcho</a> <a name="ssiundefinedecho">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Changes the string that mod_include displays when
561 a variable isn't set.</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>SSIUndefinedEcho <em>tag</em></syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>SSIUndefinedEcho "&lt;-- undef --&gt;"</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>FileInfo</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_include</td></tr><tr><td align="left" valign="top"><a href="directive-dict.html#Compatibility" class="help">Compatibility:</a></td><td>Available in version 2.0.34 and later.
562 </td></tr></table></td></tr></table><usage>
563     <p>This directive changes the string that mod_include displays
564     when a variable is not set and "echoed".</p>
565 </usage><hr/><h2><a name="XBitHack">XBitHack</a> <a name="xbithack">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Parse SSI directives in files with the execute 
566 bit set</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>XBitHack on|off|full</syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>XBitHack off</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>Options</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_include</td></tr><tr><td align="left" valign="top"><a href="directive-dict.html#Compatibility" class="help">Compatibility:</a></td><td/></tr></table></td></tr></table><usage>
567     <p>The XBitHack directives controls the parsing of ordinary
568     html documents. This directive only affects files associated
569     with the MIME type <code>text/html</code>. XBitHack can take on
570     the following values:</p>
571
572     <dl>
573       <dt>off</dt>
574
575       <dd>No special treatment of executable files.</dd>
576
577       <dt>on</dt>
578
579       <dd>Any text/html file that has the user-execute bit set will 
580       be treated as a server-parsed html document.</dd>
581
582       <dt>full</dt>
583
584       <dd>
585         As for <code>on</code> but also test the group-execute bit.
586         If it is set, then set the Last-modified date of the
587         returned file to be the last modified time of the file. If
588         it is not set, then no last-modified date is sent. Setting
589         this bit allows clients and proxies to cache the result of
590         the request. 
591
592         <blockquote><table><tr><td bgcolor="#e0e5f5"><strong>Note:</strong> you would not want to use the full
593         option, unless you assure the group-execute bit is unset for
594         every SSI script which might <code>#include</code> a CGI 
595         or otherwise produces different output on each hit (or could 
596         potentially change on subsequent requests).</td></tr></table></blockquote>
597       </dd>
598     </dl>
599
600     </usage><hr/><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img alt="Index" src="../images/index.gif"/></a><a href="../"><img alt="Home" src="../images/home.gif"/></a></blockquote></body></html>