2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
6 Copyright 2002-2004 The Apache Software Foundation
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
12 http://www.apache.org/licenses/LICENSE-2.0
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.
21 <modulesynopsis metafile="mod_include.xml.meta">
23 <name>mod_include</name>
24 <description>Server-parsed html documents (Server Side Includes)</description>
26 <sourcefile>mod_include.c</sourcefile>
27 <identifier>include_module</identifier>
28 <compatibility>Implemented as an output filter since Apache
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>
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>
44 <section id="enabling">
45 <title>Enabling Server-Side Includes</title>
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>
55 AddType text/html .shtml<br />
56 AddOutputFilter INCLUDES .shtml
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>
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>
78 <p>For more information, see our <a
79 href="../howto/ssi.html">Tutorial on Server Side Includes</a>.</p>
80 </section> <!-- /enabling -->
82 <section id="pathinfo">
83 <title>PATH_INFO with Server Side Includes</title>
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 -->
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>
97 <!--#<var>element</var> <var>attribute</var>=<var>value</var>
98 <var>attribute</var>=<var>value</var> ... -->
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>--></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><!--#</code> is <em>one</em>
107 token and may not contain any whitespaces.</p>
109 <p>The allowed elements are listed in the following table:</p>
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>
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>
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>
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>
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>
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>
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
166 </section> <!-- /config -->
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>
178 <dt><code>var</code></dt>
179 <dd>The value is the name of the variable to print.</dd>
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>
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>
201 <note type="warning">
202 In order to avoid cross-site scripting issues, you should
203 <em>always</em> encode user supplied data.
207 </section> <!-- /echo -->
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>
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>
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>
235 <example><title>Example</title>
236 <!--#exec cgi="/cgi-bin/example.cgi" -->
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>
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
250 <!--#include virtual="/cgi-bin/example.cgi?argument=value" -->
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>
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
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>
275 <!--#exec cmd="perl /path/to/perlscript arg1 arg2" -->
279 </section> <!-- /exec -->
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>
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>
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>
296 </section> <!-- /fsize -->
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 -->
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
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>
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>
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>
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>
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>
346 <!--#include virtual="/cgi-bin/example.cgi?argument=value" -->
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>
354 </section> <!-- /include -->
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>
362 <example><title>Example</title>
363 <!--#printenv -->
365 </section> <!-- /printenv -->
367 <section id="element.set"><title>The set Element</title>
368 <p>This sets the value of a variable. Attributes:</p>
371 <dt><code>var</code></dt>
372 <dd>The name of the variable to set.</dd>
374 <dt><code>value</code></dt>
375 <dd>The value to give a variable.</dd>
378 <example><title>Example</title>
379 <!--#set var="category" value="help" -->
381 </section> <!-- /set -->
382 </section> <!-- /basic elements -->
384 <section id="includevars">
385 <title>Include Variables</title>
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>
393 <dt><code>DATE_GMT</code></dt>
394 <dd>The current date in Greenwich Mean Time.</dd>
396 <dt><code>DATE_LOCAL</code></dt>
397 <dd>The current date in the local time zone.</dd>
399 <dt><code>DOCUMENT_NAME</code></dt>
400 <dd>The filename (excluding directories) of the document
401 requested by the user.</dd>
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>
408 <dt><code>LAST_MODIFIED</code></dt>
409 <dd>The last modification date of the document requested by
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>&</code> etc. are
416 preceded by backslashes).</dd>
420 <section id="substitution"><title>Variable Substitution</title>
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
432 <!--#if expr="$a = \$test" -->
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>
442 <!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" -->
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>
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>
455 <!--#if expr='"$DOCUMENT_URI" = "/foo/file.html"' --><br />
459 <!--#elif expr='"$DOCUMENT_URI" = "/bar/file.html"' --><br />
463 <!--#else --><br />
471 <section id="flowctrl">
472 <title>Flow Control Elements</title>
474 <p>The basic flow control elements are:</p>
477 <!--#if expr="<var>test_condition</var>" --><br />
478 <!--#elif expr="<var>test_condition</var>" --><br />
479 <!--#else --><br />
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
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>
493 <p>The <code>endif</code> element ends the <code>if</code> element
496 <p><var>test_condition</var> is one of the following:</p>
499 <dt><code><var>string</var></code></dt>
500 <dd>true if <var>string</var> is not empty</dd>
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>
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>
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> ..
519 <example><title>Example</title>
520 <!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" --><br />
522 <!--#set var="session" value="$1" --><br />
528 <dt><code><var>string1</var> < <var>string2</var><br />
529 <var>string1</var> <= <var>string2</var><br />
530 <var>string1</var> > <var>string2</var><br />
531 <var>string1</var> >= <var>string2</var></code></dt>
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
538 <dt><code>( <var>test_condition</var> )</code></dt>
539 <dd>true if <var>test_condition</var> is true</dd>
541 <dt><code>! <var>test_condition</var></code></dt>
542 <dd>true if <var>test_condition</var> is false</dd>
544 <dt><code><var>test_condition1</var> &&
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>
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>
555 <p>"<code>=</code>" and "<code>!=</code>" bind more tightly than
556 "<code>&&</code>" and "<code>||</code>". "<code>!</code>" binds
557 most tightly. Thus, the following are equivalent:</p>
560 <!--#if expr="$a = test1 && $b = test2" --><br />
561 <!--#if expr="($a = test1) && ($b = test2)" -->
564 <p>The boolean operators <code>&&</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>
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>
576 <p><code><var>string1</var> <var
577 >string2</var></code> results in <code><var>string1</var> <var
578 >string2</var></code><br />
582 <code>'<var>string1</var> <var
583 >string2</var>'</code> results in <code><var
584 >string1</var> <var>string2</var></code>.</p>
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>
592 <li>Expressions are evaluated from left to right</li>
593 <li>Binary boolean operators (<code>&&</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
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>
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>
613 <name>SSIEndTag</name>
614 <description>String that ends an include element</description>
615 <syntax>SSIEndTag <var>tag</var></syntax>
616 <default>SSIEndTag "-->"</default>
617 <contextlist><context>server config</context><context>virtual host</context>
619 <compatibility>Available in version 2.0.30 and later.</compatibility>
622 <p>This directive changes the string that <module>mod_include</module>
623 looks for to mark the end of an include element.</p>
625 <example><title>Example</title>
630 <seealso><directive module="mod_include">SSIStartTag</directive></seealso>
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 "(none)"</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>
644 <p>This directive changes the string that <module>mod_include</module>
645 displays when a variable is not set and "echoed".</p>
647 <example><title>Example</title>
648 SSIUndefinedEcho "<!-- undef -->"
654 <name>SSIErrorMsg</name>
655 <description>Error message displayed when there is an SSI
657 <syntax>SSIErrorMsg <var>message</var></syntax>
658 <default>SSIErrorMsg "[an error occurred while processing this
659 directive]"</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>
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>"<!-- Error -->"</code> so that
670 the message is not presented to the user.</p>
672 <p>This directive has the same effect as the <code><!--#config
673 errmsg=<var>message</var> --></code> element.</p>
675 <example><title>Example</title>
676 SSIErrorMsg "<!-- Error -->"
682 <name>SSIStartTag</name>
683 <description>String that starts an include element</description>
684 <syntax>SSIStartTag <var>tag</var></syntax>
685 <default>SSIStartTag "<!--#"</default>
686 <contextlist><context>server config</context><context>virtual host</context>
688 <compatibility>Available in version 2.0.30 and later.</compatibility>
691 <p>This directive changes the string that <module>mod_include</module>
692 looks for to mark an include element to process.</p>
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>
698 <example><title>Example</title>
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
707 <example><title>SSI directives with alternate start and end tags</title>
711 <seealso><directive module="mod_include">SSIEndTag</directive></seealso>
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 "%A, %d-%b-%Y %H:%M:%S %Z"</default>
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>
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>
732 <p>This directive has the same effect as the <code><!--#config
733 timefmt=<var>formatstring</var> --></code> element.</p>
735 <example><title>Example</title>
736 SSITimeFormat "%R, %B %d, %Y"
739 <p>The above directive would cause times to be displayed in the
740 format "22:26, June 14, 2002".</p>
745 <name>XBitHack</name>
746 <description>Parse SSI directives in files with the execute bit
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>
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>
761 <dt><code>off</code></dt>
762 <dd>No special treatment of executable files.</dd>
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>
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
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>