mod_include.xml revision ea8a19d2e0e6764e99334eb5aec0c3667eaf1f62
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml version="1.0"?>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<!-- $LastChangedRevision$ -->
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<!--
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd Licensed to the Apache Software Foundation (ASF) under one or more
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc contributor license agreements. See the NOTICE file distributed with
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd this work for additional information regarding copyright ownership.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd The ASF licenses this file to You under the Apache License, Version 2.0
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (the "License"); you may not use this file except in compliance with
2e545ce2450a9953665f701bb05350f0d3f26275nd the License. You may obtain a copy of the License at
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen http://www.apache.org/licenses/LICENSE-2.0
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd Unless required by applicable law or agreed to in writing, software
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd distributed under the License is distributed on an "AS IS" BASIS,
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3f08db06526d6901aa08c110b5bc7dde6bc39905nd See the License for the specific language governing permissions and
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd limitations under the License.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd-->
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<modulesynopsis metafile="mod_include.xml.meta">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<name>mod_include</name>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<description>Server-parsed html documents (Server Side Includes)</description>
7dc5a2d4a0c77f5bf5a95de92d68e43de7d8117anilgun<status>Base</status>
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<sourcefile>mod_include.c</sourcefile>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<identifier>include_module</identifier>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<compatibility>Implemented as an output filter since Apache
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd2.0</compatibility>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<summary>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen <p>This module provides a filter which will process files
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd before they are sent to the client. The processing is
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd controlled by specially formatted SGML comments, referred to as
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <dfn>elements</dfn>. These elements allow conditional text, the
f19fa851b976a05691dea05be46586aa5aadeba2rbowen inclusion of other files or programs, as well as the setting and
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf printing of environment variables.</p>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin</summary>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<seealso><directive module="core">Options</directive></seealso>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<seealso><directive module="core">AcceptPathInfo</directive></seealso>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<seealso><a href="/filter.html">Filters</a></seealso>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<seealso><a href="/howto/ssi.html">SSI Tutorial</a></seealso>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<section id="enabling">
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin <title>Enabling Server-Side Includes</title>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p>Server Side Includes are implemented by the
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <code>INCLUDES</code> <a href="/filter.html">filter</a>. If
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf documents containing server-side include directives are given
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin the extension .shtml, the following directives will make Apache
06ba4a61654b3763ad65f52283832ebf058fdf1cslive parse them and assign the resulting document the mime type of
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen <code>text/html</code>:</p>
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <example>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri AddType text/html .shtml<br />
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri AddOutputFilter INCLUDES .shtml
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri </example>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <p>The following directive must be given for the directories
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd containing the shtml files (typically in a
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <directive module="core" type="section">Directory</directive> section,
117c1f888a14e73cdd821dc6c23eb0411144a41cnd but this directive is also valid in <code>.htaccess</code> files if
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <directive module="core">AllowOverride</directive> <code>Options</code>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd is set):</p>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <example>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri Options +Includes
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf </example>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>For backwards compatibility, the <code>server-parsed</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <a href="/handler.html">handler</a> also activates the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar INCLUDES filter. As well, Apache will activate the INCLUDES
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar filter for any document with mime type
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>text/x-server-parsed-html</code> or
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>text/x-server-parsed-html3</code> (and the resulting
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar output will have the mime type <code>text/html</code>).</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>For more information, see our <a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar href="/howto/ssi.html">Tutorial on Server Side Includes</a>.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</section> <!-- /enabling -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<section id="pathinfo">
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <title>PATH_INFO with Server Side Includes</title>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Files processed for server-side includes no longer accept
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar requests with <code>PATH_INFO</code> (trailing pathname information)
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar by default. You can use the <directive
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar module="core">AcceptPathInfo</directive> directive to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar configure the server to accept requests with <code>PATH_INFO</code>.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</section> <!-- /pathinfo -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<section id="elements"><title>Basic Elements</title>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The document is parsed as an HTML document, with special
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar commands embedded as SGML comments. A command has the syntax: </p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <example>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar &lt;!--#<var>element</var> <var>attribute</var>=<var>value</var>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <var>attribute</var>=<var>value</var> ... --&gt;
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </example>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The value will often be enclosed in double quotes, but single
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar quotes (<code>'</code>) and backticks (<code>`</code>) are also
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar possible. Many commands only allow a single attribute-value pair.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar Note that the comment terminator (<code>--&gt;</code>) should be
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd preceded by whitespace to ensure that it isn't considered part of
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd an SSI token. Note that the leading <code>&lt;!--#</code> is <em>one</em>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd token and may not contain any whitespaces.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin <p>The allowed elements are listed in the following table:</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <table border="1">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <tr><th>Element</th><th>Description</th></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <tr><td><code><a href="#element.config">config</a></code></td>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <td>configure output formats</td></tr>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <tr><td><code><a href="#element.echo">echo</a></code></td>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <td>print variables</td></tr>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <tr><td><code><a href="#element.exec">exec</a></code></td>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>execute external programs</td></tr>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <tr><td><code><a href="#element.fsize">fsize</a></code></td>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>print size of a file</td></tr>
b9bf3918f6eaf7747bcbfbd02792bcbe4a052784nilgun <tr><td><code><a href="#element.flastmod">flastmod</a></code></td>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>print last modification time of a file</td></tr>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <tr><td><code><a href="#element.include">include</a></code></td>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>include a file</td></tr>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <tr><td><code><a href="#element.printenv">printenv</a></code></td>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>print all available variables</td></tr>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <tr><td><code><a href="#element.set">set</a></code></td>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <td>set a value of a variable</td></tr>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar </table>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <p>SSI elements may be defined by modules other than
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <module>mod_include</module>. In fact, the <code><a
172025a566937b5a0492a7060e4ba52f121047f4covener href="#element.exec">exec</a></code> element is provided by
172025a566937b5a0492a7060e4ba52f121047f4covener <module>mod_cgi</module>, and will only be available if this
06f0540592b1d6fc148e1ec9afc95ce48162db18covener module is loaded.</p>
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <section id="element.config"><title>The config Element</title>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <p>This command controls various aspects of the parsing. The
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar valid attributes are:</p>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <dl>
c3c937a1510d6ff9cfa28ef3713e787f0e1a39c9coar <dt><code>echomsg</code> (<em>Apache 2.1 and later</em>)</dt>
b475917ddf898282aa51ce31b3275c2c4783ce98coar <dd>The value is a message that is sent back to the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar client if the <code><a href="#element.echo">echo</a></code> element
17ade6df5ec233536985eb1c130a906c725dd614humbedooh attempts to echo an undefined variable. This overrides any <directive
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar module="mod_include">SSIUndefinedEcho</directive> directives.</dd>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar
4aa603e6448b99f9371397d439795c91a93637eand <dt><code>errmsg</code></dt>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <dd>The value is a message that is sent back to the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive client if an error occurs while parsing the
172025a566937b5a0492a7060e4ba52f121047f4covener document. This overrides any <directive
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd module="mod_include">SSIErrorMsg</directive> directives.</dd>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <dt><code>sizefmt</code></dt>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <dd>The value sets the format to be used when displaying
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd the size of a file. Valid values are <code>bytes</code>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd for a count in bytes, or <code>abbrev</code> for a count
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd in Kb or Mb as appropriate, for example a size of 1024 bytes
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd will be printed as "1K".</dd>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <dt><code>timefmt</code></dt>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <dd>The value is a string to be used by the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <code>strftime(3)</code> library routine when printing
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd dates.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd </section> <!-- /config -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <section id="element.echo"><title>The echo Element</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>This command prints one of the <a href="#includevars">include
fa0f379e3845907d7c1087d885169e302239bdbbnd variables</a> defined below. If the variable is unset, the result is
fa0f379e3845907d7c1087d885169e302239bdbbnd determined by the <directive module="mod_include"
fa0f379e3845907d7c1087d885169e302239bdbbnd >SSIUndefinedEcho</directive> directive. Any dates printed are
fa0f379e3845907d7c1087d885169e302239bdbbnd subject to the currently configured <code>timefmt</code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>Attributes:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <dl>
b115299831a7b4bbec58a88d708d8536e1ecd50csf <dt><code>var</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The value is the name of the variable to print.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
b115299831a7b4bbec58a88d708d8536e1ecd50csf <dt><code>encoding</code></dt>
b115299831a7b4bbec58a88d708d8536e1ecd50csf <dd><p>Specifies how Apache should encode special characters
fa0f379e3845907d7c1087d885169e302239bdbbnd contained in the variable before outputting them. If set
06ba4a61654b3763ad65f52283832ebf058fdf1cslive to <code>none</code>, no encoding will be done. If set to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>url</code>, then URL encoding (also known as %-encoding;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem this is appropriate for use within URLs in links, etc.) will be
b115299831a7b4bbec58a88d708d8536e1ecd50csf performed. At the start of an <code>echo</code> element,
fa0f379e3845907d7c1087d885169e302239bdbbnd the default is set to <code>entity</code>, resulting in entity
fa0f379e3845907d7c1087d885169e302239bdbbnd encoding (which is appropriate in the context of a block-level
b115299831a7b4bbec58a88d708d8536e1ecd50csf HTML element, <em>e.g.</em> a paragraph of text). This can be
b115299831a7b4bbec58a88d708d8536e1ecd50csf changed by adding an <code>encoding</code> attribute, which will
fa0f379e3845907d7c1087d885169e302239bdbbnd remain in effect until the next <code>encoding</code> attribute
06ba4a61654b3763ad65f52283832ebf058fdf1cslive is encountered or the element ends, whichever comes first.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>The <code>encoding</code> attribute must <em>precede</em> the
fa0f379e3845907d7c1087d885169e302239bdbbnd corresponding <code>var</code> attribute to be effective, and
fa0f379e3845907d7c1087d885169e302239bdbbnd only special characters as defined in the ISO-8859-1 character
06ba4a61654b3763ad65f52283832ebf058fdf1cslive encoding will be encoded. This encoding process may not have the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive desired result if a different character encoding is in use.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
81785f72c9d133aef57ad6b02f248345d90239aapoirier <note type="warning">
fa0f379e3845907d7c1087d885169e302239bdbbnd In order to avoid cross-site scripting issues, you should
fa0f379e3845907d7c1087d885169e302239bdbbnd <em>always</em> encode user supplied data.
fa0f379e3845907d7c1087d885169e302239bdbbnd </note>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd </section> <!-- /echo -->
c6a2d6fa44f8698851dec5051ee3782c2913605fnd
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <section id="element.exec"><title>The exec Element</title>
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p>The <code>exec</code> command executes a given shell command or
5ae30adbe59946de742ab0cd6be3b7457471a698takashi CGI script. It requires <module>mod_cgi</module> to be present
97a9a944b5887e91042b019776c41d5dd74557aferikabele in the server. If <directive module="core">Options</directive>
97a9a944b5887e91042b019776c41d5dd74557aferikabele <code>IncludesNOEXEC</code> is set, this command is completely
5ae30adbe59946de742ab0cd6be3b7457471a698takashi disabled. The valid attributes are:</p>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
97a9a944b5887e91042b019776c41d5dd74557aferikabele <dl>
97a9a944b5887e91042b019776c41d5dd74557aferikabele <dt><code>cgi</code></dt>
97a9a944b5887e91042b019776c41d5dd74557aferikabele <dd><p>The value specifies a (%-encoded) URL-path to
97a9a944b5887e91042b019776c41d5dd74557aferikabele the CGI script. If the path does not begin with a slash (/),
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc then it is taken to be relative to the current
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc document. The document referenced by this path is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive invoked as a CGI script, even if the server would not
06ba4a61654b3763ad65f52283832ebf058fdf1cslive normally recognize it as such. However, the directory
06ba4a61654b3763ad65f52283832ebf058fdf1cslive containing the script must be enabled for CGI scripts
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc (with <directive module="mod_alias">ScriptAlias</directive>
1b9c57e74f282283966fa424192df142595338bdnd or <directive module="core">Options</directive>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <code>ExecCGI</code>).</p>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <p>The CGI script is given the <code>PATH_INFO</code> and query
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc string (<code>QUERY_STRING</code>) of the original request from the
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc client; these <em>cannot</em> be specified in the URL path. The
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc include variables will be available to the script in addition to
97a9a944b5887e91042b019776c41d5dd74557aferikabele the standard <a href="mod_cgi.html">CGI</a> environment.</p>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
74a6de79356cd15d2e47065087785e36dd65aa41nd <example><title>Example</title>
97a9a944b5887e91042b019776c41d5dd74557aferikabele &lt;!--#exec cgi="/cgi-bin/example.cgi" --&gt;
97a9a944b5887e91042b019776c41d5dd74557aferikabele </example>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>If the script returns a <code>Location:</code> header instead of
5ae30adbe59946de742ab0cd6be3b7457471a698takashi output, then this will be translated into an HTML anchor.</p>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code><a href="#includevirtual">include virtual</a></code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive element should be used in preference to <code>exec cgi</code>. In
06ba4a61654b3763ad65f52283832ebf058fdf1cslive particular, if you need to pass additional arguments to a CGI program,
53d2fd50ff45e7c568f0588c742a5ef9edf8e275rbowen using the query string, this cannot be done with <code>exec
5ae30adbe59946de742ab0cd6be3b7457471a698takashi cgi</code>, but can be done with <code>include virtual</code>, as
97a9a944b5887e91042b019776c41d5dd74557aferikabele shown here:</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
5ae30adbe59946de742ab0cd6be3b7457471a698takashi <example>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </example>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </dd>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
97a9a944b5887e91042b019776c41d5dd74557aferikabele <dt><code>cmd</code></dt>
97a9a944b5887e91042b019776c41d5dd74557aferikabele <dd><p>The server will execute the given string using
97a9a944b5887e91042b019776c41d5dd74557aferikabele <code>/bin/sh</code>. The <a href="#includevars"
97a9a944b5887e91042b019776c41d5dd74557aferikabele >include variables</a> are available to the command, in addition
97a9a944b5887e91042b019776c41d5dd74557aferikabele to the usual set of CGI variables.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The use of <code><a href="#includevirtual"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive >#include virtual</a></code> is almost always prefered to using
97a9a944b5887e91042b019776c41d5dd74557aferikabele either <code>#exec cgi</code> or <code>#exec cmd</code>. The former
97a9a944b5887e91042b019776c41d5dd74557aferikabele (<code>#include virtual</code>) uses the standard Apache sub-request
97a9a944b5887e91042b019776c41d5dd74557aferikabele mechanism to include files or scripts. It is much better tested and
97a9a944b5887e91042b019776c41d5dd74557aferikabele maintained.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p>In addition, on some platforms, like Win32, and on unix when
97a9a944b5887e91042b019776c41d5dd74557aferikabele using <a href="/suexec.html">suexec</a>, you cannot pass arguments
97a9a944b5887e91042b019776c41d5dd74557aferikabele to a command in an <code>exec</code> directive, or otherwise include
06ba4a61654b3763ad65f52283832ebf058fdf1cslive spaces in the command. Thus, while the following will work under a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive non-suexec configuration on unix, it will not produce the desired
06ba4a61654b3763ad65f52283832ebf058fdf1cslive result under Win32, or when running suexec:</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <example>
fb82af0f0cd7b58eef19c54b086131b7e1e1e749madhum &lt;!--#exec cmd="perl /path/to/perlscript arg1 arg2" --&gt;
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </example>
d0091d79795017b8432ca178745dbcfb7970cd5ctrawick </dd>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </dl>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </section> <!-- /exec -->
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <section id="element.fsize"><title>The fsize Element</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This command prints the size of the specified file, subject
06ba4a61654b3763ad65f52283832ebf058fdf1cslive to the <code>sizefmt</code> format specification. Attributes:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
fa0f379e3845907d7c1087d885169e302239bdbbnd <dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>file</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The value is a path relative to the directory
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen containing the current document being parsed.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <dt><code>virtual</code></dt>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <dd>The value is a (%-encoded) URL-path. If it does not begin with
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener a slash (/) then it is taken to be relative to the current document.
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf Note, that this does <em>not</em> print the size of any CGI output,
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener but the size of the CGI script itself.</dd>
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener </dl>
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener </section> <!-- /fsize -->
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener <section id="element.flastmod"><title>The flastmod Element</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>This command prints the last modification date of the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive specified file, subject to the <code>timefmt</code> format
06ba4a61654b3763ad65f52283832ebf058fdf1cslive specification. The attributes are the same as for the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code><a href="#element.fsize">fsize</a></code> command.</p>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen </section> <!-- /flastmod -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <section id="element.include"><title>The include Element</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>This command inserts the text of another document or file
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen into the parsed file. Any included file is subject to the usual
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen access control. If the directory containing the parsed file has
fa0f379e3845907d7c1087d885169e302239bdbbnd <a href="core.html#options">Options</a>
fa0f379e3845907d7c1087d885169e302239bdbbnd <code>IncludesNOEXEC</code> set, then only documents with a text
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <glossary>MIME-type</glossary> (<code>text/plain</code>,
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <code>text/html</code> etc.) will be included. Otherwise CGI
06ba4a61654b3763ad65f52283832ebf058fdf1cslive scripts are invoked as normal using the complete URL given in
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc the command, including any query string.</p>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>An attribute defines the location of the document; the
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc inclusion is done for each attribute given to the include
06ba4a61654b3763ad65f52283832ebf058fdf1cslive command. The valid attributes are:</p>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <dl>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <dt><code>file</code></dt>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <dd>The value is a path relative to the directory
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc containing the current document being parsed. It cannot
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc contain <code>../</code>, nor can it be an absolute path.
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc Therefore, you cannot include files that are outside of the
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc document root, or above the current document in the directory
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc structure. The <code>virtual</code> attribute should always be
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc used in preference to this one.</dd>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <dt><code><a id="includevirtual" name="includevirtual"
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc >virtual</a></code></dt>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <dd><p>The value is a (%-encoded) URL-path. The URL cannot contain a
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc scheme or hostname, only a path and an optional query string. If it
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc does not begin with a slash (/) then it is taken to be relative to the
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc current document.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>A URL is constructed from the attribute, and the output the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive server would return if the URL were accessed by the client is
fa0f379e3845907d7c1087d885169e302239bdbbnd included in the parsed output. Thus included files can be nested.</p>
c0a201f9f0cda37f4e5829462c7e489f85bf327ccovener
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p>If the specified URL is a CGI program, the program will be
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf executed and its output inserted in place of the directive in the
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf parsed file. You may include a query string in a CGI url:</p>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar
15a7e433cd5ddbb53d48a11f2f8732d9ea6a48caminfrin <example>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
15a7e433cd5ddbb53d48a11f2f8732d9ea6a48caminfrin </example>
15a7e433cd5ddbb53d48a11f2f8732d9ea6a48caminfrin
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd <p><code>include virtual</code> should be used in preference
4203a35c28d7c60adb7e9ef3be87aad34951c79asf to <code>exec cgi</code> to include the output of CGI programs
4203a35c28d7c60adb7e9ef3be87aad34951c79asf into an HTML document.</p>
4eafd186275d2df6e74aaa778a57b24a6c725e49humbedooh
4203a35c28d7c60adb7e9ef3be87aad34951c79asf <p>If the <directive module="mod_request">KeptBodySize</directive>
4203a35c28d7c60adb7e9ef3be87aad34951c79asf directive is correctly configured and valid for this included
4203a35c28d7c60adb7e9ef3be87aad34951c79asf file, attempts to POST requests to the enclosing HTML document
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc will be passed through to subrequests as POST requests as well.
1b9c57e74f282283966fa424192df142595338bdnd Without the directive, all subrequests are processed as GET
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc requests.</p>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </dd>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </dl>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc </section> <!-- /include -->
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <section id="element.printenv"><title>The printenv Element</title>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <p>This prints out a listing of all existing variables and
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc their values. Special characters are entity encoded (see the <code><a
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc href="#element.echo">echo</a></code> element for details)
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc before being output. There are no attributes.</p>
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc
10e9674fc9606633f493d0e409d2bf143ccac1fejailletc <example><title>Example</title>
1b9c57e74f282283966fa424192df142595338bdnd &lt;!--#printenv --&gt;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
97a9a944b5887e91042b019776c41d5dd74557aferikabele </section> <!-- /printenv -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <section id="element.set"><title>The set Element</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>This sets the value of a variable. Attributes:</p>
c11bfe6804eff2f4c7054cf2f7b06f0c8b32e596sf
c11bfe6804eff2f4c7054cf2f7b06f0c8b32e596sf <dl>
c11bfe6804eff2f4c7054cf2f7b06f0c8b32e596sf <dt><code>var</code></dt>
c11bfe6804eff2f4c7054cf2f7b06f0c8b32e596sf <dd>The name of the variable to set.</dd>
c11bfe6804eff2f4c7054cf2f7b06f0c8b32e596sf
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf <dt><code>value</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The value to give a variable.</dd>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <example><title>Example</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd &lt;!--#set var="category" value="help" --&gt;
fa0f379e3845907d7c1087d885169e302239bdbbnd </example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </section> <!-- /set -->
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen</section> <!-- /basic elements -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<section id="includevars">
fa0f379e3845907d7c1087d885169e302239bdbbnd <title>Include Variables</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>In addition to the variables in the standard CGI environment,
fa0f379e3845907d7c1087d885169e302239bdbbnd these are available for the <code>echo</code> command, for
fa0f379e3845907d7c1087d885169e302239bdbbnd <code>if</code> and <code>elif</code>, and to any program
fa0f379e3845907d7c1087d885169e302239bdbbnd invoked by the document.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>DATE_GMT</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The current date in Greenwich Mean Time.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
a4d04b8c74044c58bd4182028a1408d936c95951covener <dt><code>DATE_LOCAL</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The current date in the local time zone.</dd>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>DOCUMENT_NAME</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The filename (excluding directories) of the document
fa0f379e3845907d7c1087d885169e302239bdbbnd requested by the user.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen <dt><code>DOCUMENT_URI</code></dt>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen <dd>The (%-decoded) URL path of the document requested by the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive user. Note that in the case of nested include files, this is
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <em>not</em> the URL for the current document. Note also that
fa0f379e3845907d7c1087d885169e302239bdbbnd if the URL is modified internally (e.g. by an <directive
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd module="mod_alias">alias</directive> or <directive
fa0f379e3845907d7c1087d885169e302239bdbbnd module="mod_dir">directoryindex</directive>), the modified
fa0f379e3845907d7c1087d885169e302239bdbbnd URL is shown.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>LAST_MODIFIED</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The last modification date of the document requested by
fa0f379e3845907d7c1087d885169e302239bdbbnd the user.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>QUERY_STRING_UNESCAPED</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>If a query string is present, this variable contains the
fa0f379e3845907d7c1087d885169e302239bdbbnd (%-decoded) query string, which is <em>escaped</em> for shell
fa0f379e3845907d7c1087d885169e302239bdbbnd usage (special characters like <code>&amp;</code> etc. are
fa0f379e3845907d7c1087d885169e302239bdbbnd preceded by backslashes).</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd</section>
37c26549741cbbff3874b385ee5540924a8b37fcjailletc
fa0f379e3845907d7c1087d885169e302239bdbbnd<section id="substitution"><title>Variable Substitution</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>Variable substitution is done within quoted strings in most
fa0f379e3845907d7c1087d885169e302239bdbbnd cases where they may reasonably occur as an argument to an SSI
fa0f379e3845907d7c1087d885169e302239bdbbnd directive. This includes the <code>config</code>,
fa0f379e3845907d7c1087d885169e302239bdbbnd <code>exec</code>, <code>flastmod</code>, <code>fsize</code>,
fa0f379e3845907d7c1087d885169e302239bdbbnd <code>include</code>, <code>echo</code>, and <code>set</code>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem directives, as well as the arguments to conditional operators.
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar You can insert a literal dollar sign into the string using backslash
025dc11c0fd8d6a7fdb5f0a46cc3a5fbab64b93drbowen quoting:</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <example>
fa0f379e3845907d7c1087d885169e302239bdbbnd &lt;!--#if expr="$a = \$test" --&gt;
fa0f379e3845907d7c1087d885169e302239bdbbnd </example>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>If a variable reference needs to be substituted in the
fa0f379e3845907d7c1087d885169e302239bdbbnd middle of a character sequence that might otherwise be
fa0f379e3845907d7c1087d885169e302239bdbbnd considered a valid identifier in its own right, it can be
fa0f379e3845907d7c1087d885169e302239bdbbnd disambiguated by enclosing the reference in braces,
fa0f379e3845907d7c1087d885169e302239bdbbnd <em>a la</em> shell substitution:</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <example>
fa0f379e3845907d7c1087d885169e302239bdbbnd &lt;!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" --&gt;
fa0f379e3845907d7c1087d885169e302239bdbbnd </example>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>This will result in the <code>Zed</code> variable being set
fa0f379e3845907d7c1087d885169e302239bdbbnd to "<code>X_Y</code>" if <code>REMOTE_HOST</code> is
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem "<code>X</code>" and <code>REQUEST_METHOD</code> is
fa0f379e3845907d7c1087d885169e302239bdbbnd "<code>Y</code>".</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>The below example will print "in foo" if the
fa0f379e3845907d7c1087d885169e302239bdbbnd <code>DOCUMENT_URI</code> is <code>/foo/file.html</code>, "in bar"
fa0f379e3845907d7c1087d885169e302239bdbbnd if it is <code>/bar/file.html</code> and "in neither" otherwise:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#if expr='"$DOCUMENT_URI" = "/foo/file.html"' --&gt;<br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <indent>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem in foo<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </indent>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive &lt;!--#elif expr='"$DOCUMENT_URI" = "/bar/file.html"' --&gt;<br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen in bar<br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen &lt;!--#else --&gt;<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <indent>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive in neither<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </indent>
b2e020677d1f9cd5c8e3a6b612d022a0515ad298covener &lt;!--#endif --&gt;
b2e020677d1f9cd5c8e3a6b612d022a0515ad298covener </example>
b2e020677d1f9cd5c8e3a6b612d022a0515ad298covener</section>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<section id="flowctrl">
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <title>Flow Control Elements</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The basic flow control elements are:</p>
81785f72c9d133aef57ad6b02f248345d90239aapoirier
5ae30adbe59946de742ab0cd6be3b7457471a698takashi <example>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#if expr="<var>test_condition</var>" --&gt;<br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#elif expr="<var>test_condition</var>" --&gt;<br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#else --&gt;<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive &lt;!--#endif --&gt;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>The <code>if</code> element works like an if statement in a
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem programming language. The test condition is evaluated and if
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem the result is true, then the text until the next <code>elif</code>,
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <code>else</code> or <code>endif</code> element is included in the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive output stream.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>The <code>elif</code> or <code>else</code> statements are used
97a9a944b5887e91042b019776c41d5dd74557aferikabele to put text into the output stream if the original
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <var>test_condition</var> was false. These elements are optional.</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>The <code>endif</code> element ends the <code>if</code> element
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem and is required.</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p><var>test_condition</var> is one of the following:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dl>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dt><code><var>string</var></code></dt>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dd>true if <var>string</var> is not empty</dd>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dt><code><var>-A string</var></code></dt>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dd><p>true if the URL represented by the string is accessible by
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen configuration, false otherwise. This test only has an effect if
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <directive>SSIAccessEnable</directive> is on. This is useful
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen where content on a page is to be hidden from users who are not
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen authorized to view the URL, such as a link to that URL. Note
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen that the URL is only tested for whether access would be granted,
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen not whether the URL exists.</p>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <example><title>Example</title>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen &lt;!--#if expr="-A /private" --&gt;<br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen Click &lt;a href="/private"&gt;here&lt;/a&gt; to access private
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen information.<br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen &lt;!--#endif --&gt;
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </example>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dt><code><var>string1</var> = <var>string2</var><br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <var>string1</var> == <var>string2</var><br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <var>string1</var> != <var>string2</var></code></dt>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dd><p>Compare <var>string1</var> with <var>string2</var>. If
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <var>string2</var> has the form <code>/<var>string2</var>/</code>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen then it is treated as a regular expression. Regular expressions are
88f586e767b7b224bdb1a178455668a2475cfc75rbowen implemented by the <a href="http://www.pcre.org">PCRE</a> engine and
88f586e767b7b224bdb1a178455668a2475cfc75rbowen have the same syntax as those in <a href="http://www.perl.com">perl
88f586e767b7b224bdb1a178455668a2475cfc75rbowen 5</a>. Note that <code>==</code> is just an alias for <code>=</code>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen and behaves exactly the same way.</p>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <p>If you are matching positive (<code>=</code> or <code>==</code>), you
88f586e767b7b224bdb1a178455668a2475cfc75rbowen can capture grouped parts of the regular expression. The captured parts
88f586e767b7b224bdb1a178455668a2475cfc75rbowen are stored in the special variables <code>$1</code> ..
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <code>$9</code>.</p>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <example><title>Example</title>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen &lt;!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" --&gt;<br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen &lt;!--#set var="session" value="$1" --&gt;<br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen &lt;!--#endif --&gt;
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </example>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dt><code><var>string1</var> &lt; <var>string2</var><br />
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <var>string1</var> &lt;= <var>string2</var><br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <var>string1</var> &gt; <var>string2</var><br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <var>string1</var> &gt;= <var>string2</var></code></dt>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dd>Compare <var>string1</var> with <var>string2</var>. Note, that
88f586e767b7b224bdb1a178455668a2475cfc75rbowen strings are compared <em>literally</em> (using
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <code>strcmp(3)</code>). Therefore the string "100" is less than
88f586e767b7b224bdb1a178455668a2475cfc75rbowen "20".</dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dt><code>( <var>test_condition</var> )</code></dt>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dd>true if <var>test_condition</var> is true</dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dt><code>! <var>test_condition</var></code></dt>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dd>true if <var>test_condition</var> is false</dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dt><code><var>test_condition1</var> &amp;&amp;
97a9a944b5887e91042b019776c41d5dd74557aferikabele <var>test_condition2</var></code></dt>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dd>true if both <var>test_condition1</var> and
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <var>test_condition2</var> are true</dd>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dt><code><var>test_condition1</var> ||
97a9a944b5887e91042b019776c41d5dd74557aferikabele <var>test_condition2</var></code></dt>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dd>true if either <var>test_condition1</var> or
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <var>test_condition2</var> is true</dd>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </dl>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p>"<code>=</code>" and "<code>!=</code>" bind more tightly than
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem "<code>&amp;&amp;</code>" and "<code>||</code>". "<code>!</code>" binds
06ba4a61654b3763ad65f52283832ebf058fdf1cslive most tightly. Thus, the following are equivalent:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <example>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#if expr="$a = test1 &amp;&amp; $b = test2" --&gt;<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive &lt;!--#if expr="($a = test1) &amp;&amp; ($b = test2)" --&gt;
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen </example>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <p>The boolean operators <code>&amp;&amp;</code> and <code>||</code>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen share the same priority. So if you want to bind such an operator more
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen tightly, you should use parentheses.</p>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <p>Anything that's not recognized as a variable or an operator
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen is treated as a string. Strings can also be quoted:
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <code>'string'</code>. Unquoted strings can't contain whitespace
88f586e767b7b224bdb1a178455668a2475cfc75rbowen (blanks and tabs) because it is used to separate tokens such as
88f586e767b7b224bdb1a178455668a2475cfc75rbowen variables. If multiple strings are found in a row, they are
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen concatenated using blanks. So,</p>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <example>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <p><code><var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen >string2</var></code> results in <code><var>string1</var>&nbsp;<var
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen >string2</var></code><br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen and<br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <code>'<var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var
b0ffb6279db3bd422faeff9a59a43dc762afe148minfrin >string2</var>'</code> results in <code><var
97a9a944b5887e91042b019776c41d5dd74557aferikabele >string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var>string2</var></code>.</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <note><title>Optimization of Boolean Expressions</title>
81785f72c9d133aef57ad6b02f248345d90239aapoirier <p>If the expressions become more complex and slow down processing
b0ffb6279db3bd422faeff9a59a43dc762afe148minfrin significantly, you can try to optimize them according to the
b0ffb6279db3bd422faeff9a59a43dc762afe148minfrin evaluation rules:</p>
b0ffb6279db3bd422faeff9a59a43dc762afe148minfrin <ul>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <li>Expressions are evaluated from left to right</li>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <li>Binary boolean operators (<code>&amp;&amp;</code> and <code>||</code>)
b0ffb6279db3bd422faeff9a59a43dc762afe148minfrin are short circuited wherever possible. In conclusion with the rule
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen above that means, <module>mod_include</module> evaluates at first
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen the left expression. If the left result is sufficient to determine
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen the end result, processing stops here. Otherwise it evaluates the
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen right side and computes the end result from both left and right
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen results.</li>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <li>Short circuit evaluation is turned off as long as there are regular
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen expressions to deal with. These must be evaluated to fill in the
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen backreference variables (<code>$1</code> .. <code>$9</code>).</li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </ul>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>If you want to look how a particular expression is handled, you can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive recompile <module>mod_include</module> using the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>-DDEBUG_INCLUDE</code> compiler option. This inserts for every
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf parsed expression tokenizer information, the parse tree and how it is
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf evaluated into the output sent to the client.</p>
c0c1f9ffbf550e6ba5e60d2d0ee55490794f3aefrbowen </note>
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen <note><title>Escaping slashes in regex strings</title>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen <p>All slashes which are not intended to act as delimiters in your regex must
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen be escaped. This is regardless of their meaning to the regex engine.</p>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen </note>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen</section>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen<directivesynopsis>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar<name>SSIEndTag</name>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar<description>String that ends an include element</description>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<syntax>SSIEndTag <var>tag</var></syntax>
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf<default>SSIEndTag &quot;--&gt;&quot;</default>
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf<contextlist><context>server config</context><context>virtual host</context>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi</contextlist>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<compatibility>Available in version 2.0.30 and later.</compatibility>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<usage>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>This directive changes the string that <module>mod_include</module>
22d5d84393d960a2027f472036f3fee15d7dbce9nd looks for to mark the end of an include element.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example><title>Example</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive SSIEndTag "%&gt;"
97a9a944b5887e91042b019776c41d5dd74557aferikabele </example>
81785f72c9d133aef57ad6b02f248345d90239aapoirier
5ae30adbe59946de742ab0cd6be3b7457471a698takashi</usage>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<seealso><directive module="mod_include">SSIStartTag</directive></seealso>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<name>SSIUndefinedEcho</name>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<description>String displayed when an unset variable is echoed</description>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<syntax>SSIUndefinedEcho <var>string</var></syntax>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<default>SSIUndefinedEcho &quot;(none)&quot;</default>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<contextlist><context>server config</context><context>virtual host</context>
81785f72c9d133aef57ad6b02f248345d90239aapoirier<context>directory</context><context>.htaccess</context></contextlist>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<override>All</override>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar<compatibility>Available in version 2.0.34 and later.</compatibility>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar<usage>
4aa603e6448b99f9371397d439795c91a93637eand <p>This directive changes the string that <module>mod_include</module>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh displays when a variable is not set and &quot;echoed&quot;.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <example><title>Example</title>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem SSIUndefinedEcho "&lt;!-- undef --&gt;"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl</usage>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl</directivesynopsis>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<directivesynopsis>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<name>SSIErrorMsg</name>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<description>Error message displayed when there is an SSI
9335f6d807d76d60e54af4ededdebebddb3e3d13noodlerror</description>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<syntax>SSIErrorMsg <var>message</var></syntax>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<default>SSIErrorMsg &quot;[an error occurred while processing this
9335f6d807d76d60e54af4ededdebebddb3e3d13noodldirective]&quot;</default>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<contextlist><context>server config</context><context>virtual host</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<context>directory</context><context>.htaccess</context></contextlist>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<override>All</override>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<compatibility>Available in version 2.0.30 and later.</compatibility>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<usage>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <directive>SSIErrorMsg</directive> directive changes the error
06ba4a61654b3763ad65f52283832ebf058fdf1cslive message displayed when <module>mod_include</module> encounters an
06ba4a61654b3763ad65f52283832ebf058fdf1cslive error. For production servers you may consider changing the default
06ba4a61654b3763ad65f52283832ebf058fdf1cslive error message to <code>&quot;&lt;!-- Error --&gt;&quot;</code> so that
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar the message is not presented to the user.</p>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This directive has the same effect as the <code>&lt;!--#config
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar errmsg=<var>message</var> --&gt;</code> element.</p>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example><title>Example</title>
81785f72c9d133aef57ad6b02f248345d90239aapoirier SSIErrorMsg "&lt;!-- Error --&gt;"
63befe0983261d711e62457b380e24ecc3b7b79etrawick </example>
63befe0983261d711e62457b380e24ecc3b7b79etrawick</usage>
63befe0983261d711e62457b380e24ecc3b7b79etrawick</directivesynopsis>
63befe0983261d711e62457b380e24ecc3b7b79etrawick
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<directivesynopsis>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<name>SSIStartTag</name>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<description>String that starts an include element</description>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<syntax>SSIStartTag <var>tag</var></syntax>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<default>SSIStartTag &quot;&lt;!--#&quot;</default>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<contextlist><context>server config</context><context>virtual host</context>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</contextlist>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<compatibility>Available in version 2.0.30 and later.</compatibility>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<usage>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <p>This directive changes the string that <module>mod_include</module>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd looks for to mark an include element to process.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
81785f72c9d133aef57ad6b02f248345d90239aapoirier <p>You may want to use this option if you have 2 servers parsing the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive output of a file each processing different commands (possibly at
06ba4a61654b3763ad65f52283832ebf058fdf1cslive different times).</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example><title>Example</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive SSIStartTag "&lt;%"<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive SSIEndTag "%&gt;"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
b81ce796b0cf3ce2d4aec801645948f3de0f6390jailletc
85c602f69721fc653724a7d1d2b477737502aff1rbowen <p>The example given above, which also specifies a matching
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <directive module="mod_include">SSIEndTag</directive>, will
4c36c711036219c80d5517d35be68a4769c15291slive allow you to use SSI directives as shown in the example
4c36c711036219c80d5517d35be68a4769c15291slive below:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
4c36c711036219c80d5517d35be68a4769c15291slive <example><title>SSI directives with alternate start and end tags</title>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd &lt;%printenv %&gt;
fc9f416faa11879811f17d6efadedbf81cfd52a1covener </example>
fc9f416faa11879811f17d6efadedbf81cfd52a1covener</usage>
fc9f416faa11879811f17d6efadedbf81cfd52a1covener<seealso><directive module="mod_include">SSIEndTag</directive></seealso>
fc9f416faa11879811f17d6efadedbf81cfd52a1covener</directivesynopsis>
fc9f416faa11879811f17d6efadedbf81cfd52a1covener
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<directivesynopsis>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<name>SSITimeFormat</name>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<description>Configures the format in which date strings are
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nddisplayed</description>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<syntax>SSITimeFormat <var>formatstring</var></syntax>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<default>SSITimeFormat &quot;%A, %d-%b-%Y %H:%M:%S %Z&quot;</default>
468902b188471fa1b19394d41ce854a50002da82covener<contextlist>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<context>server config</context><context>virtual host</context>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<context>directory</context><context>.htaccess</context></contextlist>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<override>All</override>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<compatibility>Available in version 2.0.30 and later.</compatibility>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<usage>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<p>This directive changes the format in which date strings are displayed
06ba4a61654b3763ad65f52283832ebf058fdf1cslive when echoing <code>DATE</code> environment variables. The
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <var>formatstring</var> is as in <code>strftime(3)</code> from the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive C standard library.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This directive has the same effect as the <code>&lt;!--#config
06ba4a61654b3763ad65f52283832ebf058fdf1cslive timefmt=<var>formatstring</var> --&gt;</code> element.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example><title>Example</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive SSITimeFormat "%R, %B %d, %Y"
97a9a944b5887e91042b019776c41d5dd74557aferikabele </example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p>The above directive would cause times to be displayed in the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive format "22:26, June 14, 2002".</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</usage>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</directivesynopsis>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<directivesynopsis>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<name>SSIAccessEnable</name>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<description>Enable the -A flag during conditional flow control processing.</description>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<syntax>SSIAccessEnable on|off</syntax>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<default>SSIAccessEnable off</default>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<contextlist><context>directory</context><context>.htaccess</context></contextlist>
7992de7f9e82ab86effe3dcc5279fb959f6c398dcovener
7992de7f9e82ab86effe3dcc5279fb959f6c398dcovener<usage>
7992de7f9e82ab86effe3dcc5279fb959f6c398dcovener <p>The <directive>SSIAccessEnable</directive> directive controls whether
06ba4a61654b3763ad65f52283832ebf058fdf1cslive the -A test is enabled during conditional flow control processing.
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen <directive>SSIAccessEnable</directive> can take on the following values:</p>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen <dl>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <dt><code>off</code></dt>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen <dd>&lt;!--#if expr="-A /foo"--&gt; will be interpreted as a series
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen of string and regular expression tokens, the -A has no special
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen meaning.</dd>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <dt><code>on</code></dt>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <dd>&lt;!--#if expr="-A /foo"--&gt; will evaluate to false if the
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen URL /foo is inaccessible by configuration, or true otherwise.</dd>
468902b188471fa1b19394d41ce854a50002da82covener
468902b188471fa1b19394d41ce854a50002da82covener </dl>
468902b188471fa1b19394d41ce854a50002da82covener
468902b188471fa1b19394d41ce854a50002da82covener</usage>
468902b188471fa1b19394d41ce854a50002da82covener</directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<name>XBitHack</name>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<description>Parse SSI directives in files with the execute bit
790a477f6ce41161c4173c1e5080a1f569976a1erbowenset</description>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<syntax>XBitHack on|off|full</syntax>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<default>XBitHack off</default>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<contextlist><context>server config</context><context>virtual host</context>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<context>directory</context><context>.htaccess</context></contextlist>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<override>Options</override>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<usage>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen <p>The <directive>XBitHack</directive> directive controls the parsing
790a477f6ce41161c4173c1e5080a1f569976a1erbowen of ordinary html documents. This directive only affects files associated
0a3142725875ea286597e083547d34d98f8c1f2drbowen with the <glossary>MIME-type</glossary> <code>text/html</code>. <directive
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf >XBitHack</directive> can take on the following values:</p>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen
0a3142725875ea286597e083547d34d98f8c1f2drbowen <dl>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen <dt><code>off</code></dt>
e3248eba424ca31b252fbc567032d10082fefd01covener <dd>No special treatment of executable files.</dd>
e3248eba424ca31b252fbc567032d10082fefd01covener
e3248eba424ca31b252fbc567032d10082fefd01covener <dt><code>on</code></dt>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen <dd>Any <code>text/html</code> file that has the user-execute bit
790a477f6ce41161c4173c1e5080a1f569976a1erbowen set will be treated as a server-parsed html document.</dd>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen
790a477f6ce41161c4173c1e5080a1f569976a1erbowen <dt><code>full</code></dt>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen <dd>As for <code>on</code> but also test the group-execute bit.
790a477f6ce41161c4173c1e5080a1f569976a1erbowen If it is set, then set the <code>Last-modified</code> date of the
790a477f6ce41161c4173c1e5080a1f569976a1erbowen returned file to be the last modified time of the file. If
790a477f6ce41161c4173c1e5080a1f569976a1erbowen it is not set, then no last-modified date is sent. Setting
790a477f6ce41161c4173c1e5080a1f569976a1erbowen this bit allows clients and proxies to cache the result of
0a3142725875ea286597e083547d34d98f8c1f2drbowen the request.
0a3142725875ea286597e083547d34d98f8c1f2drbowen
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <note><title>Note</title>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <p>You would not want to use the full option, unless you assure the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd group-execute bit is unset for every SSI script which might <code
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd >#include</code> a CGI or otherwise produces different output on
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd each hit (or could potentially change on subsequent requests).</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd </note>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd </dd>
0203b896e484dfb877111aceffb812401d0f216and </dl>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</usage>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</directivesynopsis>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</modulesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive