mod_include.xml revision b115299831a7b4bbec58a88d708d8536e1ecd50c
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
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd 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
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen 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,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd 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>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd AddType text/html .shtml<br />
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd AddOutputFilter INCLUDES .shtml
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd </example>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <p>The following directive must be given for the directories
117c1f888a14e73cdd821dc6c23eb0411144a41cnd 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
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <directive module="core">AllowOverride</directive> <code>Options</code>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf is set):</p>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf
7571ea383299910bead3e93e66246cb212a28d0figalic <example>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf Options +Includes
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf </example>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf
7571ea383299910bead3e93e66246cb212a28d0figalic <p>For backwards compatibility, the <code>server-parsed</code>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf <a href="/handler.html">handler</a> also activates the
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf INCLUDES filter. As well, Apache will activate the INCLUDES
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf filter for any document with mime type
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf <code>text/x-server-parsed-html</code> or
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf <code>text/x-server-parsed-html3</code> (and the resulting
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf output will have the mime type <code>text/html</code>).</p>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf <p>For more information, see our <a
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf href="/howto/ssi.html">Tutorial on Server Side Includes</a>.</p>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf</section> <!-- /enabling -->
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf
1f0a28764a0520e43ce3a9130e56236fd67cd568igalic<section id="pathinfo">
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf <title>PATH_INFO with Server Side Includes</title>
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf
e487d6c09669296f94a5190cc34586a98e624a00nd <p>Files processed for server-side includes no longer accept
1e6708ac9aebbbd0ff63c2b93e6b97d50263a8bbrbowen requests with <code>PATH_INFO</code> (trailing pathname information)
17ade6df5ec233536985eb1c130a906c725dd614humbedooh by default. You can use the <directive
e487d6c09669296f94a5190cc34586a98e624a00nd module="core">AcceptPathInfo</directive> directive to
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin configure the server to accept requests with <code>PATH_INFO</code>.</p>
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen</section> <!-- /pathinfo -->
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen<section id="elements"><title>Basic Elements</title>
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen <p>The document is parsed as an HTML document, with special
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen commands embedded as SGML comments. A command has the syntax: </p>
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen <example>
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen &lt;!--#<var>element</var> <var>attribute</var>=<var>value</var>
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen <var>attribute</var>=<var>value</var> ... --&gt;
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen </example>
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen <p>The value will often be enclosed in double quotes, but single
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen quotes (<code>'</code>) and backticks (<code>`</code>) are also
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen possible. Many commands only allow a single attribute-value pair.
9b3696c7ad70387ecd46e0f061b99d381dc392f9rbowen Note that the comment terminator (<code>--&gt;</code>) should be
b41a0dbe6310c576e96b7ea6910051fd84fb06f5sf 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
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <p>The allowed elements are listed in the following table:</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin <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>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <tr><td><code><a href="#element.echo">echo</a></code></td>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <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>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <tr><td><code><a href="#element.flastmod">flastmod</a></code></td>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>print last modification time of a file</td></tr>
b9bf3918f6eaf7747bcbfbd02792bcbe4a052784nilgun <tr><td><code><a href="#element.include">include</a></code></td>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>include a file</td></tr>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <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>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <td>set a value of a variable</td></tr>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener </table>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <p>SSI elements may be defined by modules other than
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <module>mod_include</module>. In fact, the <code><a
06f0540592b1d6fc148e1ec9afc95ce48162db18covener href="#element.exec">exec</a></code> element is provided by
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin <module>mod_cgi</module>, and will only be available if this
06f0540592b1d6fc148e1ec9afc95ce48162db18covener module is loaded.</p>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <section id="element.config"><title>The config Element</title>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <p>This command controls various aspects of the parsing. The
06f0540592b1d6fc148e1ec9afc95ce48162db18covener valid attributes are:</p>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <dl>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <dt><code>echomsg</code> (<em>Apache 2.1 and later</em>)</dt>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener <dd>The value is a message that is sent back to the
17ade6df5ec233536985eb1c130a906c725dd614humbedooh client if the <code><a href="#element.echo">echo</a></code> element
17ade6df5ec233536985eb1c130a906c725dd614humbedooh attempts to echo an undefined variable. This overrides any <directive
17ade6df5ec233536985eb1c130a906c725dd614humbedooh module="mod_include">SSIUndefinedEcho</directive> directives.</dd>
06f0540592b1d6fc148e1ec9afc95ce48162db18covener
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <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
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd 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
fa0f379e3845907d7c1087d885169e302239bdbbnd 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
06ba4a61654b3763ad65f52283832ebf058fdf1cslive subject to the currently configured <code>timefmt</code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>Attributes:</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
b115299831a7b4bbec58a88d708d8536e1ecd50csf <dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>var</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The value is the name of the variable to print.</dd>
b115299831a7b4bbec58a88d708d8536e1ecd50csf
b115299831a7b4bbec58a88d708d8536e1ecd50csf <dt><code>encoding</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd><p>Specifies how Apache should encode special characters
06ba4a61654b3763ad65f52283832ebf058fdf1cslive contained in the variable before outputting them. If set
06ba4a61654b3763ad65f52283832ebf058fdf1cslive to <code>none</code>, no encoding will be done. If set to
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <code>url</code>, then URL encoding (also known as %-encoding;
b115299831a7b4bbec58a88d708d8536e1ecd50csf this is appropriate for use within URLs in links, etc.) will be
fa0f379e3845907d7c1087d885169e302239bdbbnd performed. At the start of an <code>echo</code> element,
fa0f379e3845907d7c1087d885169e302239bdbbnd the default is set to <code>entity</code>, resulting in entity
b115299831a7b4bbec58a88d708d8536e1ecd50csf 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
fa0f379e3845907d7c1087d885169e302239bdbbnd changed by adding an <code>encoding</code> attribute, which will
06ba4a61654b3763ad65f52283832ebf058fdf1cslive remain in effect until the next <code>encoding</code> attribute
06ba4a61654b3763ad65f52283832ebf058fdf1cslive is encountered or the element ends, whichever comes first.</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>The <code>encoding</code> attribute must <em>precede</em> the
fa0f379e3845907d7c1087d885169e302239bdbbnd corresponding <code>var</code> attribute to be effective, and
06ba4a61654b3763ad65f52283832ebf058fdf1cslive only special characters as defined in the ISO-8859-1 character
06ba4a61654b3763ad65f52283832ebf058fdf1cslive encoding will be encoded. This encoding process may not have the
fa0f379e3845907d7c1087d885169e302239bdbbnd desired result if a different character encoding is in use.</p>
81785f72c9d133aef57ad6b02f248345d90239aapoirier
fa0f379e3845907d7c1087d885169e302239bdbbnd <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>
c6a2d6fa44f8698851dec5051ee3782c2913605fnd </section> <!-- /echo -->
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele <section id="element.exec"><title>The exec Element</title>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi <p>The <code>exec</code> command executes a given shell command or
97a9a944b5887e91042b019776c41d5dd74557aferikabele CGI script. It requires <module>mod_cgi</module> to be present
97a9a944b5887e91042b019776c41d5dd74557aferikabele in the server. If <directive module="core">Options</directive>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi <code>IncludesNOEXEC</code> is set, this command is completely
5ae30adbe59946de742ab0cd6be3b7457471a698takashi disabled. The valid attributes are:</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
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 (/),
97a9a944b5887e91042b019776c41d5dd74557aferikabele then it is taken to be relative to the current
06ba4a61654b3763ad65f52283832ebf058fdf1cslive 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
97a9a944b5887e91042b019776c41d5dd74557aferikabele containing the script must be enabled for CGI scripts
97a9a944b5887e91042b019776c41d5dd74557aferikabele (with <directive module="mod_alias">ScriptAlias</directive>
74a6de79356cd15d2e47065087785e36dd65aa41nd or <directive module="core">Options</directive>
97a9a944b5887e91042b019776c41d5dd74557aferikabele <code>ExecCGI</code>).</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p>The CGI script is given the <code>PATH_INFO</code> and query
97a9a944b5887e91042b019776c41d5dd74557aferikabele string (<code>QUERY_STRING</code>) of the original request from the
97a9a944b5887e91042b019776c41d5dd74557aferikabele client; these <em>cannot</em> be specified in the URL path. The
97a9a944b5887e91042b019776c41d5dd74557aferikabele include variables will be available to the script in addition to
97a9a944b5887e91042b019776c41d5dd74557aferikabele the standard <a href="mod_cgi.html">CGI</a> environment.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
5ae30adbe59946de742ab0cd6be3b7457471a698takashi <example><title>Example</title>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi &lt;!--#exec cgi="/cgi-bin/example.cgi" --&gt;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>If the script returns a <code>Location:</code> header instead of
53d2fd50ff45e7c568f0588c742a5ef9edf8e275rbowen output, then this will be translated into an HTML anchor.</p>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p>The <code><a href="#includevirtual">include virtual</a></code>
97a9a944b5887e91042b019776c41d5dd74557aferikabele element should be used in preference to <code>exec cgi</code>. In
5ae30adbe59946de742ab0cd6be3b7457471a698takashi particular, if you need to pass additional arguments to a CGI program,
5ae30adbe59946de742ab0cd6be3b7457471a698takashi using the query string, this cannot be done with <code>exec
97a9a944b5887e91042b019776c41d5dd74557aferikabele cgi</code>, but can be done with <code>include virtual</code>, as
97a9a944b5887e91042b019776c41d5dd74557aferikabele shown here:</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele <example>
97a9a944b5887e91042b019776c41d5dd74557aferikabele &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
97a9a944b5887e91042b019776c41d5dd74557aferikabele </example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </dd>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <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>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p>The use of <code><a href="#includevirtual"
97a9a944b5887e91042b019776c41d5dd74557aferikabele >#include virtual</a></code> is almost always prefered to using
97a9a944b5887e91042b019776c41d5dd74557aferikabele either <code>#exec cgi</code> or <code>#exec cmd</code>. The former
06ba4a61654b3763ad65f52283832ebf058fdf1cslive (<code>#include virtual</code>) uses the standard Apache sub-request
06ba4a61654b3763ad65f52283832ebf058fdf1cslive mechanism to include files or scripts. It is much better tested and
06ba4a61654b3763ad65f52283832ebf058fdf1cslive 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
97a9a944b5887e91042b019776c41d5dd74557aferikabele spaces in the command. Thus, while the following will work under a
fb82af0f0cd7b58eef19c54b086131b7e1e1e749madhum non-suexec configuration on unix, it will not produce the desired
4203a35c28d7c60adb7e9ef3be87aad34951c79asf result under Win32, or when running suexec:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive &lt;!--#exec cmd="perl /path/to/perlscript arg1 arg2" --&gt;
fa0f379e3845907d7c1087d885169e302239bdbbnd </example>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dl>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen </section> <!-- /exec -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <section id="element.fsize"><title>The fsize Element</title>
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener <p>This command prints the size of the specified file, subject
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener to the <code>sizefmt</code> format specification. Attributes:</p>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener <dl>
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener <dt><code>file</code></dt>
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener <dd>The value is a path relative to the directory
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener containing the current document being parsed.</dd>
37ef4b86270a8e58f87aa5fe558e3e65af97991ccovener
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>virtual</code></dt>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dd>The value is a (%-encoded) URL-path. If it does not begin with
06ba4a61654b3763ad65f52283832ebf058fdf1cslive a slash (/) then it is taken to be relative to the current document.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive Note, that this does <em>not</em> print the size of any CGI output,
fa0f379e3845907d7c1087d885169e302239bdbbnd but the size of the CGI script itself.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dl>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </section> <!-- /fsize -->
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <section id="element.flastmod"><title>The flastmod Element</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <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
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen <code><a href="#element.fsize">fsize</a></code> command.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd </section> <!-- /flastmod -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <section id="element.include"><title>The include Element</title>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen <p>This command inserts the text of another document or file
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen into the parsed file. Any included file is subject to the usual
fa0f379e3845907d7c1087d885169e302239bdbbnd access control. If the directory containing the parsed file has
fa0f379e3845907d7c1087d885169e302239bdbbnd <a href="core.html#options">Options</a>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>IncludesNOEXEC</code> set, then only documents with a text
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <glossary>MIME-type</glossary> (<code>text/plain</code>,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>text/html</code> etc.) will be included. Otherwise CGI
06ba4a61654b3763ad65f52283832ebf058fdf1cslive scripts are invoked as normal using the complete URL given in
06ba4a61654b3763ad65f52283832ebf058fdf1cslive the command, including any query string.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>An attribute defines the location of the document; the
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf inclusion is done for each attribute given to the include
777c17c11c2b1638f191241364e034779851d186covener command. The valid attributes are:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dl>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dt><code>file</code></dt>
0844fff26cb7719e0f0a368d88544156ed6374b6sf <dd>The value is a path relative to the directory
0844fff26cb7719e0f0a368d88544156ed6374b6sf containing the current document being parsed. It cannot
0844fff26cb7719e0f0a368d88544156ed6374b6sf contain <code>../</code>, nor can it be an absolute path.
0844fff26cb7719e0f0a368d88544156ed6374b6sf Therefore, you cannot include files that are outside of the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive document root, or above the current document in the directory
06ba4a61654b3763ad65f52283832ebf058fdf1cslive structure. The <code>virtual</code> attribute should always be
06ba4a61654b3763ad65f52283832ebf058fdf1cslive used in preference to this one.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
c0a201f9f0cda37f4e5829462c7e489f85bf327ccovener <dt><code><a id="includevirtual" name="includevirtual"
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf >virtual</a></code></dt>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <dd><p>The value is a (%-encoded) URL-path. The URL cannot contain a
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf scheme or hostname, only a path and an optional query string. If it
c0a201f9f0cda37f4e5829462c7e489f85bf327ccovener does not begin with a slash (/) then it is taken to be relative to the
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd current document.</p>
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd <p>A URL is constructed from the attribute, and the output the
fa0f379e3845907d7c1087d885169e302239bdbbnd 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>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>If the specified URL is a CGI program, the program will be
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd executed and its output inserted in place of the directive in the
4203a35c28d7c60adb7e9ef3be87aad34951c79asf parsed file. You may include a query string in a CGI url:</p>
4203a35c28d7c60adb7e9ef3be87aad34951c79asf
4203a35c28d7c60adb7e9ef3be87aad34951c79asf <example>
4203a35c28d7c60adb7e9ef3be87aad34951c79asf &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
4203a35c28d7c60adb7e9ef3be87aad34951c79asf </example>
4203a35c28d7c60adb7e9ef3be87aad34951c79asf
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p><code>include virtual</code> should be used in preference
97a9a944b5887e91042b019776c41d5dd74557aferikabele to <code>exec cgi</code> to include the output of CGI programs
fa0f379e3845907d7c1087d885169e302239bdbbnd into an HTML document.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>If the <directive module="mod_request">KeptBodySize</directive>
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf directive is correctly configured and valid for this included
c0c1f9ffbf550e6ba5e60d2d0ee55490794f3aefrbowen file, attempts to POST requests to the enclosing HTML document
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf will be passed through to subrequests as POST requests as well.
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf Without the directive, all subrequests are processed as GET
fa0f379e3845907d7c1087d885169e302239bdbbnd requests.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
fa0f379e3845907d7c1087d885169e302239bdbbnd </dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd </section> <!-- /include -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <section id="element.printenv"><title>The printenv Element</title>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen <p>This prints out a listing of all existing variables and
fa0f379e3845907d7c1087d885169e302239bdbbnd their values. Special characters are entity encoded (see the <code><a
fa0f379e3845907d7c1087d885169e302239bdbbnd href="#element.echo">echo</a></code> element for details)
fa0f379e3845907d7c1087d885169e302239bdbbnd before being output. There are no attributes.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <example><title>Example</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd &lt;!--#printenv --&gt;
fa0f379e3845907d7c1087d885169e302239bdbbnd </example>
fa0f379e3845907d7c1087d885169e302239bdbbnd </section> <!-- /printenv -->
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <section id="element.set"><title>The set Element</title>
fa0f379e3845907d7c1087d885169e302239bdbbnd <p>This sets the value of a variable. Attributes:</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <dl>
a4d04b8c74044c58bd4182028a1408d936c95951covener <dt><code>var</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The name of the variable to set.</dd>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>value</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The value to give a variable.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd </dl>
fa0f379e3845907d7c1087d885169e302239bdbbnd
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen <example><title>Example</title>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen &lt;!--#set var="category" value="help" --&gt;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </section> <!-- /set -->
fa0f379e3845907d7c1087d885169e302239bdbbnd</section> <!-- /basic elements -->
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd
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
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>DATE_LOCAL</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The current date in the local time zone.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>DOCUMENT_NAME</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The filename (excluding directories) of the document
fa0f379e3845907d7c1087d885169e302239bdbbnd requested by the user.</dd>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd <dt><code>DOCUMENT_URI</code></dt>
fa0f379e3845907d7c1087d885169e302239bdbbnd <dd>The (%-decoded) URL path of the document requested by the
fa0f379e3845907d7c1087d885169e302239bdbbnd 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
fa0f379e3845907d7c1087d885169e302239bdbbnd 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>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<section id="substitution"><title>Variable Substitution</title>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
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>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directives, as well as the arguments to conditional operators.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive You can insert a literal dollar sign into the string using backslash
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem quoting:</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive &lt;!--#if expr="$a = \$test" --&gt;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <p>If a variable reference needs to be substituted in the
88f586e767b7b224bdb1a178455668a2475cfc75rbowen middle of a character sequence that might otherwise be
88f586e767b7b224bdb1a178455668a2475cfc75rbowen considered a valid identifier in its own right, it can be
06ba4a61654b3763ad65f52283832ebf058fdf1cslive disambiguated by enclosing the reference in braces,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <em>a la</em> shell substitution:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive &lt;!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" --&gt;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <p>This will result in the <code>Zed</code> variable being set
06ba4a61654b3763ad65f52283832ebf058fdf1cslive to "<code>X_Y</code>" if <code>REMOTE_HOST</code> is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "<code>X</code>" and <code>REQUEST_METHOD</code> is
81785f72c9d133aef57ad6b02f248345d90239aapoirier "<code>Y</code>".</p>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>The below example will print "in foo" if the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <code>DOCUMENT_URI</code> is <code>/foo/file.html</code>, "in bar"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem 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 />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </indent>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#elif expr='"$DOCUMENT_URI" = "/bar/file.html"' --&gt;<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <indent>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive in bar<br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </indent>
97a9a944b5887e91042b019776c41d5dd74557aferikabele &lt;!--#else --&gt;<br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <indent>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem in neither<br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </indent>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#endif --&gt;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </example>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem</section>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<section id="flowctrl">
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <title>Flow Control Elements</title>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <p>The basic flow control elements are:</p>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <example>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen &lt;!--#if expr="<var>test_condition</var>" --&gt;<br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen &lt;!--#elif expr="<var>test_condition</var>" --&gt;<br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen &lt;!--#else --&gt;<br />
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen &lt;!--#endif --&gt;
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen </example>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <p>The <code>if</code> element works like an if statement in a
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen programming language. The test condition is evaluated and if
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen the result is true, then the text until the next <code>elif</code>,
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <code>else</code> or <code>endif</code> element is included in the
88f586e767b7b224bdb1a178455668a2475cfc75rbowen output stream.</p>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <p>The <code>elif</code> or <code>else</code> statements are used
88f586e767b7b224bdb1a178455668a2475cfc75rbowen to put text into the output stream if the original
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <var>test_condition</var> was false. These elements are optional.</p>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <p>The <code>endif</code> element ends the <code>if</code> element
88f586e767b7b224bdb1a178455668a2475cfc75rbowen and is required.</p>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <p><var>test_condition</var> is one of the following:</p>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dl>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dt><code><var>string</var></code></dt>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dd>true if <var>string</var> is not empty</dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dt><code><var>-A string</var></code></dt>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dd><p>true if the URL represented by the string is accessible by
88f586e767b7b224bdb1a178455668a2475cfc75rbowen configuration, false otherwise. This test only has an effect if
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <directive>SSIAccessEnable</directive> is on. This is useful
88f586e767b7b224bdb1a178455668a2475cfc75rbowen where content on a page is to be hidden from users who are not
88f586e767b7b224bdb1a178455668a2475cfc75rbowen authorized to view the URL, such as a link to that URL. Note
88f586e767b7b224bdb1a178455668a2475cfc75rbowen that the URL is only tested for whether access would be granted,
88f586e767b7b224bdb1a178455668a2475cfc75rbowen not whether the URL exists.</p>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <example><title>Example</title>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen &lt;!--#if expr="-A /private" --&gt;<br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen Click &lt;a href="/private"&gt;here&lt;/a&gt; to access private
88f586e767b7b224bdb1a178455668a2475cfc75rbowen information.<br />
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </indent>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen &lt;!--#endif --&gt;
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </example>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen </dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <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>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
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> ..
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>$9</code>. The whole string matched by the regular expression is
97a9a944b5887e91042b019776c41d5dd74557aferikabele stored in the special variable <code>$0</code></p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <example><title>Example</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive &lt;!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" --&gt;<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <indent>
97a9a944b5887e91042b019776c41d5dd74557aferikabele &lt;!--#set var="session" value="$1" --&gt;<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </indent>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &lt;!--#endif --&gt;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </dd>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <dt><code><var>string1</var> &lt; <var>string2</var><br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <var>string1</var> &lt;= <var>string2</var><br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <var>string1</var> &gt; <var>string2</var><br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <var>string1</var> &gt;= <var>string2</var></code></dt>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dd>Compare <var>string1</var> with <var>string2</var>. Note, that
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen strings are compared <em>literally</em> (using
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <code>strcmp(3)</code>). Therefore the string "100" is less than
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen "20".</dd>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dt><code>( <var>test_condition</var> )</code></dt>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dd>true if <var>test_condition</var> is true</dd>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dt><code>! <var>test_condition</var></code></dt>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dd>true if <var>test_condition</var> is false</dd>
88f586e767b7b224bdb1a178455668a2475cfc75rbowen
88f586e767b7b224bdb1a178455668a2475cfc75rbowen <dt><code><var>test_condition1</var> &amp;&amp;
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <var>test_condition2</var></code></dt>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dd>true if both <var>test_condition1</var> and
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <var>test_condition2</var> are true</dd>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dt><code><var>test_condition1</var> ||
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <var>test_condition2</var></code></dt>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <dd>true if either <var>test_condition1</var> or
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen <var>test_condition2</var> is true</dd>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen </dl>
3b1807171c3f06d8951da1bf23c5f51961c274bbrbowen
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>"<code>=</code>" and "<code>!=</code>" bind more tightly than
97a9a944b5887e91042b019776c41d5dd74557aferikabele "<code>&amp;&amp;</code>" and "<code>||</code>". "<code>!</code>" binds
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem most tightly. Thus, the following are equivalent:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example>
81785f72c9d133aef57ad6b02f248345d90239aapoirier &lt;!--#if expr="$a = test1 &amp;&amp; $b = test2" --&gt;<br />
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem &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:
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>'string'</code>. Unquoted strings can't contain whitespace
06ba4a61654b3763ad65f52283832ebf058fdf1cslive (blanks and tabs) because it is used to separate tokens such as
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem variables. If multiple strings are found in a row, they are
06ba4a61654b3763ad65f52283832ebf058fdf1cslive concatenated using blanks. So,</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example>
97a9a944b5887e91042b019776c41d5dd74557aferikabele <p><code><var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var
06ba4a61654b3763ad65f52283832ebf058fdf1cslive >string2</var></code> results in <code><var>string1</var>&nbsp;<var
06ba4a61654b3763ad65f52283832ebf058fdf1cslive >string2</var></code><br />
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf <br />
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf and<br />
c0c1f9ffbf550e6ba5e60d2d0ee55490794f3aefrbowen <br />
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf <code>'<var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen >string2</var>'</code> results in <code><var
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen >string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var>string2</var></code>.</p>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen </example>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen <note><title>Optimization of Boolean Expressions</title>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen <p>If the expressions become more complex and slow down processing
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen significantly, you can try to optimize them according to the
17ade6df5ec233536985eb1c130a906c725dd614humbedooh evaluation rules:</p>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen <ul>
fa1092e17f0b85a610379ac564334ad879ed7dbarbowen <li>Expressions are evaluated from left to right</li>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <li>Binary boolean operators (<code>&amp;&amp;</code> and <code>||</code>)
17ade6df5ec233536985eb1c130a906c725dd614humbedooh are short circuited wherever possible. In conclusion with the rule
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf above that means, <module>mod_include</module> evaluates at first
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf the left expression. If the left result is sufficient to determine
5ae30adbe59946de742ab0cd6be3b7457471a698takashi the end result, processing stops here. Otherwise it evaluates the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem right side and computes the end result from both left and right
06ba4a61654b3763ad65f52283832ebf058fdf1cslive results.</li>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <li>Short circuit evaluation is turned off as long as there are regular
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem expressions to deal with. These must be evaluated to fill in the
22d5d84393d960a2027f472036f3fee15d7dbce9nd 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
97a9a944b5887e91042b019776c41d5dd74557aferikabele <code>-DDEBUG_INCLUDE</code> compiler option. This inserts for every
81785f72c9d133aef57ad6b02f248345d90239aapoirier parsed expression tokenizer information, the parse tree and how it is
5ae30adbe59946de742ab0cd6be3b7457471a698takashi evaluated into the output sent to the client.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </note>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <note><title>Escaping slashes in regex strings</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>All slashes which are not intended to act as delimiters in your regex must
06ba4a61654b3763ad65f52283832ebf058fdf1cslive be escaped. This is regardless of their meaning to the regex engine.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </note>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</section>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<directivesynopsis>
81785f72c9d133aef57ad6b02f248345d90239aapoirier<name>SSIEndTag</name>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<description>String that ends an include element</description>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<syntax>SSIEndTag <var>tag</var></syntax>
025069f3f8c6b59e730a72c229329dfad5a28424rbowen<default>SSIEndTag &quot;--&gt;&quot;</default>
025069f3f8c6b59e730a72c229329dfad5a28424rbowen<contextlist><context>server config</context><context>virtual host</context>
025069f3f8c6b59e730a72c229329dfad5a28424rbowen</contextlist>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<compatibility>Available in version 2.0.30 and later.</compatibility>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<usage>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This directive changes the string that <module>mod_include</module>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem looks for to mark the end of an include element.</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <example><title>Example</title>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl SSIEndTag "%&gt;"
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl </example>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl</usage>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<seealso><directive module="mod_include">SSIStartTag</directive></seealso>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl</directivesynopsis>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<directivesynopsis>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<name>SSIUndefinedEcho</name>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl<description>String displayed when an unset variable is echoed</description>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<syntax>SSIUndefinedEcho <var>string</var></syntax>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<default>SSIUndefinedEcho &quot;(none)&quot;</default>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<contextlist><context>server config</context><context>virtual host</context>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<context>directory</context><context>.htaccess</context></contextlist>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<override>All</override>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<compatibility>Available in version 2.0.34 and later.</compatibility>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<usage>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This directive changes the string that <module>mod_include</module>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive displays when a variable is not set and &quot;echoed&quot;.</p>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh
7171511e7e2c17e9b54cc34dc247266b70138d6crbowen <example><title>Example</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive SSIUndefinedEcho "&lt;!-- undef --&gt;"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </example>
7171511e7e2c17e9b54cc34dc247266b70138d6crbowen</usage>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<directivesynopsis>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<name>SSIErrorMsg</name>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<description>Error message displayed when there is an SSI
06ba4a61654b3763ad65f52283832ebf058fdf1csliveerror</description>
81785f72c9d133aef57ad6b02f248345d90239aapoirier<syntax>SSIErrorMsg <var>message</var></syntax>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<default>SSIErrorMsg &quot;[an error occurred while processing this
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemdirective]&quot;</default>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<contextlist><context>server config</context><context>virtual host</context>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<context>directory</context><context>.htaccess</context></contextlist>
81785f72c9d133aef57ad6b02f248345d90239aapoirier<override>All</override>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<compatibility>Available in version 2.0.30 and later.</compatibility>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<usage>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>The <directive>SSIErrorMsg</directive> directive changes the error
06ba4a61654b3763ad65f52283832ebf058fdf1cslive message displayed when <module>mod_include</module> encounters an
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd error. For production servers you may consider changing the default
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd error message to <code>&quot;&lt;!-- Error --&gt;&quot;</code> so that
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd the message is not presented to the user.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <p>This directive has the same effect as the <code>&lt;!--#config
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd errmsg=<var>message</var> --&gt;</code> element.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <example><title>Example</title>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd SSIErrorMsg "&lt;!-- Error --&gt;"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd </example>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</usage>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</directivesynopsis>
81785f72c9d133aef57ad6b02f248345d90239aapoirier
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<name>SSIStartTag</name>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<description>String that starts an include element</description>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<syntax>SSIStartTag <var>tag</var></syntax>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<default>SSIStartTag &quot;&lt;!--#&quot;</default>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<contextlist><context>server config</context><context>virtual host</context>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</contextlist>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<compatibility>Available in version 2.0.30 and later.</compatibility>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<usage>
4c36c711036219c80d5517d35be68a4769c15291slive <p>This directive changes the string that <module>mod_include</module>
4c36c711036219c80d5517d35be68a4769c15291slive looks for to mark an include element to process.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
4c36c711036219c80d5517d35be68a4769c15291slive <p>You may want to use this option if you have 2 servers parsing the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd output of a file each processing different commands (possibly at
fc9f416faa11879811f17d6efadedbf81cfd52a1covener different times).</p>
fc9f416faa11879811f17d6efadedbf81cfd52a1covener
fc9f416faa11879811f17d6efadedbf81cfd52a1covener <example><title>Example</title>
fc9f416faa11879811f17d6efadedbf81cfd52a1covener SSIStartTag "&lt;%"<br />
fc9f416faa11879811f17d6efadedbf81cfd52a1covener SSIEndTag "%&gt;"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd </example>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <p>The example given above, which also specifies a matching
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <directive module="mod_include">SSIEndTag</directive>, will
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd allow you to use SSI directives as shown in the example
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd below:</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <example><title>SSI directives with alternate start and end tags</title>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd &lt;%printenv %&gt;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd </example>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</usage>
cea021a7fc2657b091df4d3b031c4254ec371dd7rbowen<seealso><directive module="mod_include">SSIEndTag</directive></seealso>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<directivesynopsis>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<name>SSITimeFormat</name>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<description>Configures the format in which date strings are
06ba4a61654b3763ad65f52283832ebf058fdf1cslivedisplayed</description>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<syntax>SSITimeFormat <var>formatstring</var></syntax>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<default>SSITimeFormat &quot;%A, %d-%b-%Y %H:%M:%S %Z&quot;</default>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<contextlist>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<context>server config</context><context>virtual host</context>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<context>directory</context><context>.htaccess</context></contextlist>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<override>All</override>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<compatibility>Available in version 2.0.30 and later.</compatibility>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele<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
97a9a944b5887e91042b019776c41d5dd74557aferikabele C standard library.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <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"
7992de7f9e82ab86effe3dcc5279fb959f6c398dcovener </example>
7992de7f9e82ab86effe3dcc5279fb959f6c398dcovener
7992de7f9e82ab86effe3dcc5279fb959f6c398dcovener <p>The above directive would cause times to be displayed in the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive format "22:26, June 14, 2002".</p>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen</usage>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen</directivesynopsis>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<directivesynopsis>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen<name>SSIAccessEnable</name>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<description>Enable the -A flag during conditional flow control processing.</description>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh<syntax>SSIAccessEnable on|off</syntax>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen<default>SSIAccessEnable off</default>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen<contextlist><context>directory</context><context>.htaccess</context></contextlist>
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen<usage>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <p>The <directive>SSIAccessEnable</directive> directive controls whether
8ac3ff7008df949c096f9cd8f769c7893594f61fnd the -A test is enabled during conditional flow control processing.
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <directive>SSIAccessEnable</directive> can take on the following values:</p>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen <dl>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dt><code>off</code></dt>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dd>&lt;!--#if expr="-A /foo"--&gt; will be interpreted as a series
790a477f6ce41161c4173c1e5080a1f569976a1erbowen of string and regular expression tokens, the -A has no special
790a477f6ce41161c4173c1e5080a1f569976a1erbowen meaning.</dd>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen
790a477f6ce41161c4173c1e5080a1f569976a1erbowen <dt><code>on</code></dt>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen <dd>&lt;!--#if expr="-A /foo"--&gt; will evaluate to false if the
790a477f6ce41161c4173c1e5080a1f569976a1erbowen URL /foo is inaccessible by configuration, or true otherwise.</dd>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen
790a477f6ce41161c4173c1e5080a1f569976a1erbowen </dl>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen
790a477f6ce41161c4173c1e5080a1f569976a1erbowen</usage>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen</directivesynopsis>
0a3142725875ea286597e083547d34d98f8c1f2drbowen
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<directivesynopsis>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen<name>XBitHack</name>
0a3142725875ea286597e083547d34d98f8c1f2drbowen<description>Parse SSI directives in files with the execute bit
790a477f6ce41161c4173c1e5080a1f569976a1erbowenset</description>
e3248eba424ca31b252fbc567032d10082fefd01covener<syntax>XBitHack on|off|full</syntax>
e3248eba424ca31b252fbc567032d10082fefd01covener<default>XBitHack off</default>
e3248eba424ca31b252fbc567032d10082fefd01covener<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
790a477f6ce41161c4173c1e5080a1f569976a1erbowen with the <glossary>MIME-type</glossary> <code>text/html</code>. <directive
790a477f6ce41161c4173c1e5080a1f569976a1erbowen >XBitHack</directive> can take on the following values:</p>
790a477f6ce41161c4173c1e5080a1f569976a1erbowen
0a3142725875ea286597e083547d34d98f8c1f2drbowen <dl>
0a3142725875ea286597e083547d34d98f8c1f2drbowen <dt><code>off</code></dt>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dd>No special treatment of executable files.</dd>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <dt><code>on</code></dt>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <dd>Any <code>text/html</code> file that has the user-execute bit
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd set will be treated as a server-parsed html document.</dd>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <dt><code>full</code></dt>
0203b896e484dfb877111aceffb812401d0f216and <dd>As for <code>on</code> but also test the group-execute bit.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd If it is set, then set the <code>Last-modified</code> date of the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd returned file to be the last modified time of the file. If
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd it is not set, then no last-modified date is sent. Setting
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd this bit allows clients and proxies to cache the result of
844def494f17cb1ab0983427d5c3939e1a03ff8cnd the request.
0203b896e484dfb877111aceffb812401d0f216and
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <note><title>Note</title>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>You would not want to use the full option, unless you assure the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive group-execute bit is unset for every SSI script which might <code
06ba4a61654b3763ad65f52283832ebf058fdf1cslive >#include</code> a CGI or otherwise produces different output on
81785f72c9d133aef57ad6b02f248345d90239aapoirier each hit (or could potentially change on subsequent requests).</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem </note>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </dd>
0203b896e484dfb877111aceffb812401d0f216and </dl>
8681ae721fdee17238ebfb7edaeb5c3edc9f1a33nd
1437d609a6e92c3f32dfdb0d63fce4fd2243fa0frbowen</usage>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf</directivesynopsis>
1437d609a6e92c3f32dfdb0d63fce4fd2243fa0frbowen
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem</modulesynopsis>
0203b896e484dfb877111aceffb812401d0f216and
0203b896e484dfb877111aceffb812401d0f216and