97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive This file is generated from xml source: DO NOT EDIT
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc<title>mod_include - Apache HTTP Server Version 2.5</title>
b686b6a420bde7f78c416b90be11db94cb789979nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
b686b6a420bde7f78c416b90be11db94cb789979nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
2e545ce2450a9953665f701bb05350f0d3f26275nd<script src="/style/scripts/prettify.min.js" type="text/javascript">
b686b6a420bde7f78c416b90be11db94cb789979nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
b686b6a420bde7f78c416b90be11db94cb789979nd<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.5</a> > <a href="./">Modules</a></div>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<p><span>Available Languages: </span><a href="/en/mod/mod_include.html" title="English"> en </a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/ja/mod/mod_include.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
b686b6a420bde7f78c416b90be11db94cb789979nd<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Server-parsed html documents (Server Side Includes)</td></tr>
b686b6a420bde7f78c416b90be11db94cb789979nd<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
b686b6a420bde7f78c416b90be11db94cb789979nd<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>include_module</td></tr>
b09fcdfc59ada4712150e7bcc7b502bb9e4601d8rjung<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_include.c</td></tr></table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This module provides a filter which will process files
06ba4a61654b3763ad65f52283832ebf058fdf1cslive before they are sent to the client. The processing is
491856cfdee8ce7c5eb4d4886784713bebad2e80nd controlled by specially formatted SGML comments, referred to as
491856cfdee8ce7c5eb4d4886784713bebad2e80nd <dfn>elements</dfn>. These elements allow conditional text, the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive inclusion of other files or programs, as well as the setting and
06ba4a61654b3763ad65f52283832ebf058fdf1cslive printing of environment variables.</p>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri<li><img alt="" src="/images/down.gif" /> <a href="#enabling">Enabling Server-Side Includes</a></li>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri<li><img alt="" src="/images/down.gif" /> <a href="#pathinfo">PATH_INFO with Server Side Includes</a></li>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri<li><img alt="" src="/images/down.gif" /> <a href="#elements">Available Elements</a></li>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri<li><img alt="" src="/images/down.gif" /> <a href="#includevars">Include Variables</a></li>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri<li><img alt="" src="/images/down.gif" /> <a href="#substitution">Variable Substitution</a></li>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri<li><img alt="" src="/images/down.gif" /> <a href="#flowctrl">Flow Control Elements</a></li>
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri<li><img alt="" src="/images/down.gif" /> <a href="#legacyexpr">Legacy expression syntax</a></li>
b686b6a420bde7f78c416b90be11db94cb789979nd<li><img alt="" src="/images/down.gif" /> <a href="#ssiendtag">SSIEndTag</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#ssierrormsg">SSIErrorMsg</a></li>
e797af4d7b0cada1278d72d6c8ac77210ef78632minfrin<li><img alt="" src="/images/down.gif" /> <a href="#ssietag">SSIETag</a></li>
e797af4d7b0cada1278d72d6c8ac77210ef78632minfrin<li><img alt="" src="/images/down.gif" /> <a href="#ssilastmodified">SSILastModified</a></li>
fcd7f1f7d11d39b8379972a455e1c7e67a5dfa9dsf<li><img alt="" src="/images/down.gif" /> <a href="#ssilegacyexprparser">SSILegacyExprParser</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#ssistarttag">SSIStartTag</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#ssitimeformat">SSITimeFormat</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#ssiundefinedecho">SSIUndefinedEcho</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#xbithack">XBitHack</a></li>
b686b6a420bde7f78c416b90be11db94cb789979nd<li><code class="directive"><a href="/mod/core.html#options">Options</a></code></li>
b686b6a420bde7f78c416b90be11db94cb789979nd<li><code class="directive"><a href="/mod/core.html#acceptpathinfo">AcceptPathInfo</a></code></li>
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
b686b6a420bde7f78c416b90be11db94cb789979nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<h2><a name="enabling" id="enabling">Enabling Server-Side Includes</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Server Side Includes are implemented by the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>INCLUDES</code> <a href="/filter.html">filter</a>. If
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar documents containing server-side include directives are given
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the extension .shtml, the following directives will make Apache
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar parse them and assign the resulting document the mime type of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">AddType text/html .shtml
1f1b6bf13313fdd14a45e52e553d3ff28689b717coarAddOutputFilter INCLUDES .shtml</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The following directive must be given for the directories
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar containing the shtml files (typically in a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="directive"><a href="/mod/core.html#directory"><Directory></a></code> section,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar but this directive is also valid in <code>.htaccess</code> files if
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="directive"><a href="/mod/core.html#allowoverride">AllowOverride</a></code> <code>Options</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar is set):</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">Options +Includes</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>For backwards compatibility, the <code>server-parsed</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar INCLUDES filter. As well, Apache will activate the INCLUDES
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar filter for any document with mime type
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>text/x-server-parsed-html3</code> (and the resulting
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar output will have the mime type <code>text/html</code>).</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>For more information, see our <a href="/howto/ssi.html">Tutorial on Server Side Includes</a>.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<h2><a name="pathinfo" id="pathinfo">PATH_INFO with Server Side Includes</a></h2>
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 <code class="directive"><a href="/mod/core.html#acceptpathinfo">AcceptPathInfo</a></code> directive to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar configure the server to accept requests with <code>PATH_INFO</code>.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<h2><a name="elements" id="elements">Available Elements</a></h2>
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 <!--#<var>element</var> <var>attribute</var>=<var>value</var>
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>--></code>) should be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar preceded by whitespace to ensure that it isn't considered part of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar an SSI token. Note that the leading <code><!--#</code> is <em>one</em>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar token and may not contain any whitespaces.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The allowed elements are listed in the following table:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.config">config</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.echo">echo</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.exec">exec</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.fsize">fsize</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.flastmod">flastmod</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.include">include</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.printenv">printenv</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <tr><td><code><a href="#element.set">set</a></code></td>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>SSI elements may be defined by modules other than
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>. In fact, the <code><a href="#element.exec">exec</a></code> element is provided by
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code>, and will only be available if this
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar module is loaded.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.config" id="element.config">The config Element</a></h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This command controls various aspects of the parsing. The
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar valid attributes are:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dt><code>echomsg</code> (<em>Apache 2.1 and later</em>)</dt>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar client if the <code><a href="#element.echo">echo</a></code> element
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar attempts to echo an undefined variable. This overrides any <code class="directive"><a href="#ssiundefinedecho">SSIUndefinedEcho</a></code> directives.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#config echomsg="[Value Undefined]" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar client if an error occurs while parsing the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar document. This overrides any <code class="directive"><a href="#ssierrormsg">SSIErrorMsg</a></code> directives.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#config errmsg="[Oops, something broke.]" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><p>The value sets the format to be used when displaying
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the size of a file. Valid values are <code>bytes</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar for a count in bytes, or <code>abbrev</code> for a count
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar in Kb or Mb as appropriate, for example a size of 1024 bytes
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar will be printed as "1K".</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#config sizefmt="abbrev" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar dates.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#config timefmt=""%R, %B %d, %Y"" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.echo" id="element.echo">The echo Element</a></h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This command prints one of the <a href="#includevars">include
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar variables</a> defined below. If the variable is unset, the result is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar determined by the <code class="directive"><a href="#ssiundefinedecho">SSIUndefinedEcho</a></code> directive. Any dates printed are
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar subject to the currently configured <code>timefmt</code>.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>The value is the name of the variable to print.</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><p>Specifies whether Apache should strip an encoding from
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the variable before processing the variable further. The default
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar is <code>none</code>, where no decoding will be done. If set to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>url</code>, then URL decoding (also known as %-encoding;
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar this is appropriate for use within URLs in links, etc.) will be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar application/x-www-form-urlencoded compatible encoding (found in
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar query strings) will be stripped. If set to <code>base64</code>,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar base64 will be decoded, and if set to <code>entity</code>, HTML
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar entity encoding will be stripped. Decoding is done prior to any
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar further encoding on the variable. Multiple encodings can be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar stripped by specifying more than one comma separated encoding.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar The decoding setting will remain in effect until the next decoding
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar attribute is encountered, or the element ends.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code>decoding</code> attribute must <em>precede</em> the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar corresponding <code>var</code> attribute to be effective.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><p>Specifies how Apache should encode special characters
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar contained in the variable before outputting them. If set
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar to <code>none</code>, no encoding will be done. If set to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>url</code>, then URL encoding (also known as %-encoding;
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar this is appropriate for use within URLs in links, etc.) will be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar application/x-www-form-urlencoded compatible encoding will be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar performed instead, and should be used with query strings. If set
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar to <code>base64</code>, base64 encoding will be performed. At
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the start of an <code>echo</code> element, the default is set to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>entity</code>, resulting in entity encoding (which is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar appropriate in the context of a block-level HTML element,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <em>e.g.</em> a paragraph of text). This can be changed by adding
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar an <code>encoding</code> attribute, which will remain in effect
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar until the next <code>encoding</code> attribute is encountered or
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the element ends, whichever comes first.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code>encoding</code> attribute must <em>precede</em> the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar corresponding <code>var</code> attribute to be effective.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar In order to avoid cross-site scripting issues, you should
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#echo encoding="entity" var="QUERY_STRING" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.exec" id="element.exec">The exec Element</a></h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code>exec</code> command executes a given shell command or
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar CGI script. It requires <code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code> to be present
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar in the server. If <code class="directive"><a href="/mod/core.html#options">Options</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>IncludesNOEXEC</code> is set, this command is completely
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar disabled. The valid attributes are:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the CGI script. If the path does not begin with a slash (/),
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar then it is taken to be relative to the current
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar document. The document referenced by this path is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar invoked as a CGI script, even if the server would not
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar normally recognize it as such. However, the directory
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar containing the script must be enabled for CGI scripts
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar (with <code class="directive"><a href="/mod/mod_alias.html#scriptalias">ScriptAlias</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar or <code class="directive"><a href="/mod/core.html#options">Options</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The CGI script is given the <code>PATH_INFO</code> and query
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar string (<code>QUERY_STRING</code>) of the original request from the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar client; these <em>cannot</em> be specified in the URL path. The
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar include variables will be available to the script in addition to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the standard <a href="mod_cgi.html">CGI</a> environment.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>If the script returns a <code>Location:</code> header instead of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar output, then this will be translated into an HTML anchor.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code><a href="#includevirtual">include virtual</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar element should be used in preference to <code>exec cgi</code>. In
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar particular, if you need to pass additional arguments to a CGI program,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar using the query string, this cannot be done with <code>exec
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar cgi</code>, but can be done with <code>include virtual</code>, as
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar shown here:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#include virtual="/cgi-bin/example.cgi?argument=value" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>/bin/sh</code>. The <a href="#includevars">include variables</a> are available to the command, in addition
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar to the usual set of CGI variables.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The use of <code><a href="#includevirtual">#include virtual</a></code> is almost always prefered to using
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar either <code>#exec cgi</code> or <code>#exec cmd</code>. The former
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar (<code>#include virtual</code>) uses the standard Apache sub-request
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar mechanism to include files or scripts. It is much better tested and
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar maintained.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>In addition, on some platforms, like Win32, and on unix when
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar using <a href="/suexec.html">suexec</a>, you cannot pass arguments
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar to a command in an <code>exec</code> directive, or otherwise include
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar spaces in the command. Thus, while the following will work under a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar non-suexec configuration on unix, it will not produce the desired
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar result under Win32, or when running suexec:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#exec cmd="perl /path/to/perlscript arg1 arg2" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.fsize" id="element.fsize">The fsize Element</a></h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This command prints the size of the specified file, subject
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar to the <code>sizefmt</code> format specification. Attributes:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>The value is a path relative to the directory
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar containing the current document being parsed.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar This file is <!--#fsize file="mod_include.html" --> bytes.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar The value of <code>file</code> cannot start with a slash
a99c5d4cc3cab6a62b04d52000dbc22ce1fa2d94coar (<code>/</code>), nor can it contain <code>../</code> so as to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar refer to a file above the current directory or outside of the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar document root. Attempting to so will result in the error message:
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>The value is a (%-encoded) URL-path. If it does not begin with
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar a slash (/) then it is taken to be relative to the current document.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar Note, that this does <em>not</em> print the size of any CGI output,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar but the size of the CGI script itself.</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar This file is <!--#fsize virtual="/docs/mod/mod_include.html" --> bytes.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Note that in many cases these two are exactly the same thing.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar However, the <code>file</code> attribute doesn't respect URL-space
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar aliases.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.flastmod" id="element.flastmod">The flastmod Element</a></h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This command prints the last modification date of the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar specified file, subject to the <code>timefmt</code> format
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar specification. The attributes are the same as for the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code><a href="#element.fsize">fsize</a></code> command.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.include" id="element.include">The include Element</a></h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This command inserts the text of another document or file
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar into the parsed file. Any included file is subject to the usual
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar access control. If the directory containing the parsed file has
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>IncludesNOEXEC</code> set, then only documents with a text
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME-type</a> (<code>text/plain</code>,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>text/html</code> etc.) will be included. Otherwise CGI
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar scripts are invoked as normal using the complete URL given in
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the command, including any query string.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>An attribute defines the location of the document, and may
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar appear more than once in an include element; an inclusion is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar done for each attribute given to the include command in turn.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar The valid attributes are:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>The value is a path relative to the directory
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar containing the current document being parsed. It cannot
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar contain <code>../</code>, nor can it be an absolute path.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar Therefore, you cannot include files that are outside of the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar document root, or above the current document in the directory
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar structure. The <code>virtual</code> attribute should always be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar used in preference to this one.</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dt><code><a id="includevirtual" name="includevirtual">virtual</a></code></dt>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><p>The value is a (%-encoded) URL-path. The URL cannot contain a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar scheme or hostname, only a path and an optional query string. If it
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar does not begin with a slash (/) then it is taken to be relative to the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar current document.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>A URL is constructed from the attribute, and the output the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar server would return if the URL were accessed by the client is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar included in the parsed output. Thus included files can be nested.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>If the specified URL is a CGI program, the program will be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar executed and its output inserted in place of the directive in the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar parsed file. You may include a query string in a CGI url:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#include virtual="/cgi-bin/example.cgi?argument=value" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p><code>include virtual</code> should be used in preference
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar to <code>exec cgi</code> to include the output of CGI programs
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar into an HTML document.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>If the <code class="directive"><a href="/mod/mod_request.html#keptbodysize">KeptBodySize</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar directive is correctly configured and valid for this included
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar file, attempts to POST requests to the enclosing HTML document
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar will be passed through to subrequests as POST requests as well.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar Without the directive, all subrequests are processed as GET
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar requests.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><p>The value is a (%-encoded) URL-path which is shown should a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar previous attempt to include a file or virtual attribute failed.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar To be effective, this attribute must be specified after the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar file or virtual attributes being covered. If the attempt to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar include the onerror path fails, or if onerror is not specified, the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar default error message will be included.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar # Simple example<br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#include virtual="/not-exist.html" onerror="/error.html" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar # Dedicated onerror paths<br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#include virtual="/path-a.html" onerror="/error-a.html" virtual="/path-b.html" onerror="/error-b.html" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.printenv" id="element.printenv">The printenv Element</a></h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This prints out a plain text listing of all existing variables and
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar their values. Special characters are entity encoded (see the <code><a href="#element.echo">echo</a></code> element for details)
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar before being output. There are no attributes.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#printenv -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <h3><a name="element.set" id="element.set">The set Element</a></h3>
fd9401e51a6e07fe680e870ba9f028c176970aa8minfrin <dd><p>Specifies whether Apache should strip an encoding from
fd9401e51a6e07fe680e870ba9f028c176970aa8minfrin the variable before processing the variable further. The default
fd9401e51a6e07fe680e870ba9f028c176970aa8minfrin is <code>none</code>, where no decoding will be done. If set to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>url</code>, <code>urlencoded</code>, <code>base64</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar application/x-www-form-urlencoded decoding, base64 decoding or HTML
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar entity decoding will be performed respectively. More than one
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar decoding can be specified by separating with commas. The decoding
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar setting will remain in effect until the next decoding attribute
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar is encountered, or the element ends. The <code>decoding</code>
fd9401e51a6e07fe680e870ba9f028c176970aa8minfrin <dd><p>Specifies how Apache should encode special characters
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar contained in the variable before setting them. The default is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>none</code>, where no encoding will be done. If set to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>url</code>, <code>urlencoding</code>, <code>base64</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar application/x-www-form-urlencoded encoding, base64 encoding or
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar HTML entity encoding will be performed respectively. More than
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar one encoding can be specified by separating with commas. The
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar encoding setting will remain in effect until the next encoding
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar attribute is encountered, or the element ends. The
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>encoding</code> attribute must <em>precede</em> the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar corresponding <code>var</code> attribute to be effective.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar Encodings are applied after all decodings have been
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar stripped.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#set var="category" value="help" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<h2><a name="includevars" id="includevars">Include Variables</a></h2>
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>In addition to the variables in the standard CGI environment,
564ee5b847469eb8a61120179ce70a0213965785rbowen these are available for the <code>echo</code> command, for
564ee5b847469eb8a61120179ce70a0213965785rbowen <code>if</code> and <code>elif</code>, and to any program
564ee5b847469eb8a61120179ce70a0213965785rbowen invoked by the document.</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <dd>The filename (excluding directories) of the document
564ee5b847469eb8a61120179ce70a0213965785rbowen requested by the user.</dd>
564ee5b847469eb8a61120179ce70a0213965785rbowen <dd>The (%-decoded) URL path of the document requested by the
564ee5b847469eb8a61120179ce70a0213965785rbowen user. Note that in the case of nested include files, this is
564ee5b847469eb8a61120179ce70a0213965785rbowen <em>not</em> the URL for the current document. Note also that
564ee5b847469eb8a61120179ce70a0213965785rbowen if the URL is modified internally (e.g. by an <code class="directive"><a href="/mod/mod_alias.html#alias">alias</a></code> or <code class="directive"><a href="/mod/mod_dir.html#directoryindex">directoryindex</a></code>), the modified
564ee5b847469eb8a61120179ce70a0213965785rbowen URL is shown.</dd>
564ee5b847469eb8a61120179ce70a0213965785rbowen <dd>The last modification date of the document requested by
564ee5b847469eb8a61120179ce70a0213965785rbowen the user.</dd>
564ee5b847469eb8a61120179ce70a0213965785rbowen <dd>If a query string is present, this variable contains the
564ee5b847469eb8a61120179ce70a0213965785rbowen (%-decoded) query string, which is <em>escaped</em> for shell
564ee5b847469eb8a61120179ce70a0213965785rbowen usage (special characters like <code>&</code> etc. are
564ee5b847469eb8a61120179ce70a0213965785rbowen preceded by backslashes).</dd>
564ee5b847469eb8a61120179ce70a0213965785rbowen</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
564ee5b847469eb8a61120179ce70a0213965785rbowen<h2><a name="substitution" id="substitution">Variable Substitution</a></h2>
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>Variable substitution is done within quoted strings in most
564ee5b847469eb8a61120179ce70a0213965785rbowen cases where they may reasonably occur as an argument to an SSI
564ee5b847469eb8a61120179ce70a0213965785rbowen <code>exec</code>, <code>flastmod</code>, <code>fsize</code>,
564ee5b847469eb8a61120179ce70a0213965785rbowen <code>include</code>, <code>echo</code>, and <code>set</code>
564ee5b847469eb8a61120179ce70a0213965785rbowen directives. If <code class="directive"><a href="#ssilegacyexprparser">SSILegacyExprParser</a></code> is set to <code>on</code>,
564ee5b847469eb8a61120179ce70a0213965785rbowen substitution also occurs in the arguments to conditional operators.
564ee5b847469eb8a61120179ce70a0213965785rbowen You can insert a literal dollar sign into the string using backslash
564ee5b847469eb8a61120179ce70a0213965785rbowen quoting:</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#set var="cur" value="\$test" -->
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>If a variable reference needs to be substituted in the
564ee5b847469eb8a61120179ce70a0213965785rbowen middle of a character sequence that might otherwise be
564ee5b847469eb8a61120179ce70a0213965785rbowen considered a valid identifier in its own right, it can be
564ee5b847469eb8a61120179ce70a0213965785rbowen disambiguated by enclosing the reference in braces,
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" -->
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>This will result in the <code>Zed</code> variable being set
564ee5b847469eb8a61120179ce70a0213965785rbowen</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
564ee5b847469eb8a61120179ce70a0213965785rbowen<h2><a name="flowctrl" id="flowctrl">Flow Control Elements</a></h2>
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#if expr="<var>test_condition</var>" --><br />
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#elif expr="<var>test_condition</var>" --><br />
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#else --><br />
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#endif -->
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>The <code>if</code> element works like an if statement in a
564ee5b847469eb8a61120179ce70a0213965785rbowen programming language. The test condition is evaluated and if
564ee5b847469eb8a61120179ce70a0213965785rbowen the result is true, then the text until the next <code>elif</code>,
564ee5b847469eb8a61120179ce70a0213965785rbowen <code>else</code> or <code>endif</code> element is included in the
564ee5b847469eb8a61120179ce70a0213965785rbowen output stream.</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>The <code>elif</code> or <code>else</code> statements are used
564ee5b847469eb8a61120179ce70a0213965785rbowen to put text into the output stream if the original
564ee5b847469eb8a61120179ce70a0213965785rbowen <var>test_condition</var> was false. These elements are optional.</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>The <code>endif</code> element ends the <code>if</code> element
564ee5b847469eb8a61120179ce70a0213965785rbowen and is required.</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <p><var>test_condition</var> is a boolean expression which follows the
564ee5b847469eb8a61120179ce70a0213965785rbowen <a href="/expr.html">ap_expr</a> syntax. The syntax can be changed
564ee5b847469eb8a61120179ce70a0213965785rbowen to be compatible with Apache HTTPD 2.2.x using <code class="directive"><a href="#ssilegacyexprparser">SSILegacyExprParser</a></code>.</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>The SSI variables set with the <code>var</code> element are exported
564ee5b847469eb8a61120179ce70a0213965785rbowen into the request environment and can be accessed with the
564ee5b847469eb8a61120179ce70a0213965785rbowen <code>reqenv</code> function. As a short-cut, the function name
564ee5b847469eb8a61120179ce70a0213965785rbowen <code>v</code> is also available inside <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>.</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <p>The below example will print "from local net" if client IP address
564ee5b847469eb8a61120179ce70a0213965785rbowen belongs to the 10.0.0.0/8 subnet.</p>
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#if expr='-R "10.0.0.0/8"' --><br />
564ee5b847469eb8a61120179ce70a0213965785rbowen from local net<br />
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#else --><br />
564ee5b847469eb8a61120179ce70a0213965785rbowen from somewhere else<br />
564ee5b847469eb8a61120179ce70a0213965785rbowen <!--#endif -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The below example will print "foo is bar" if the variable
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#if expr='v("foo") = "bar"' --><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar foo is bar<br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#endif -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>See also: <a href="/expr.html">Expressions in Apache HTTP Server</a>,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar for a complete reference and examples. The <em>restricted</em> functions
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar are not available inside <code class="module"><a href="/mod/mod_include.html">mod_include</a></code></p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<h2><a name="legacyexpr" id="legacyexpr">Legacy expression syntax</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This section describes the syntax of the <code>#if expr</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar element if <code class="directive"><a href="#ssilegacyexprparser">SSILegacyExprParser</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><p>true if the URL represented by the string is accessible by
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar configuration, false otherwise. This is useful where content on a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar page is to be hidden from users who are not authorized to view the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar URL, such as a link to that URL. Note that the URL is only tested
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar for whether access would be granted, not whether the URL exists.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#if expr="-A /private" --><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar Click <a href="/private">here</a> to access private
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar information.<br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#endif -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dt><code><var>string1</var> = <var>string2</var><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><p>Compare <var>string1</var> with <var>string2</var>. If
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <var>string2</var> has the form <code>/<var>string2</var>/</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar then it is treated as a regular expression. Regular expressions are
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar implemented by the <a href="http://www.pcre.org">PCRE</a> engine and
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar have the same syntax as those in <a href="http://www.perl.com">perl
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar 5</a>. Note that <code>==</code> is just an alias for <code>=</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar and behaves exactly the same way.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>If you are matching positive (<code>=</code> or <code>==</code>), you
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar can capture grouped parts of the regular expression. The captured parts
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>$9</code>. The whole string matched by the regular expression is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" --><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#set var="session" value="$1" --><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#endif -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dt><code><var>string1</var> < <var>string2</var><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <var>string1</var> >= <var>string2</var></code></dt>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>Compare <var>string1</var> with <var>string2</var>. Note, that
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>strcmp(3)</code>). Therefore the string "100" is less than
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar "20".</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>"<code>=</code>" and "<code>!=</code>" bind more tightly than
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar "<code>&&</code>" and "<code>||</code>". "<code>!</code>" binds
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar most tightly. Thus, the following are equivalent:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#if expr="$a = test1 && $b = test2" --><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <!--#if expr="($a = test1) && ($b = test2)" -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The boolean operators <code>&&</code> and <code>||</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar share the same priority. So if you want to bind such an operator more
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar tightly, you should use parentheses.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Anything that's not recognized as a variable or an operator
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar is treated as a string. Strings can also be quoted:
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>'string'</code>. Unquoted strings can't contain whitespace
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar (blanks and tabs) because it is used to separate tokens such as
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar variables. If multiple strings are found in a row, they are
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar concatenated using blanks. So,</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <div class="example"><p><code><var>string1</var> <var>string2</var></code> results in <code><var>string1</var> <var>string2</var></code><br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>'<var>string1</var> <var>string2</var>'</code> results in <code><var>string1</var> <var>string2</var></code>.</p></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <div class="note"><h3>Optimization of Boolean Expressions</h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>If the expressions become more complex and slow down processing
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar significantly, you can try to optimize them according to the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar evaluation rules:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <li>Binary boolean operators (<code>&&</code> and <code>||</code>)
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar are short circuited wherever possible. In conclusion with the rule
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar above that means, <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> evaluates at first
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the left expression. If the left result is sufficient to determine
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the end result, processing stops here. Otherwise it evaluates the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar right side and computes the end result from both left and right
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar results.</li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <li>Short circuit evaluation is turned off as long as there are regular
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar expressions to deal with. These must be evaluated to fill in the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar backreference variables (<code>$1</code> .. <code>$9</code>).</li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>If you want to look how a particular expression is handled, you can
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar recompile <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> using the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>-DDEBUG_INCLUDE</code> compiler option. This inserts for every
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar parsed expression tokenizer information, the parse tree and how it is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar evaluated into the output sent to the client.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <div class="note"><h3>Escaping slashes in regex strings</h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>All slashes which are not intended to act as delimiters in your regex must
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar be escaped. This is regardless of their meaning to the regex engine.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSIEndTag" id="SSIEndTag">SSIEndTag</a> <a name="ssiendtag" id="ssiendtag">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String that ends an include element</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIEndTag <var>tag</var></code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIEndTag "-->"</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This directive changes the string that <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar looks for to mark the end of an include element.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">SSIEndTag "%>"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<li><code class="directive"><a href="#ssistarttag">SSIStartTag</a></code></li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSIErrorMsg" id="SSIErrorMsg">SSIErrorMsg</a> <a name="ssierrormsg" id="ssierrormsg">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Error message displayed when there is an SSI
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIErrorMsg <var>message</var></code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIErrorMsg "[an error occurred while processing this
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code class="directive">SSIErrorMsg</code> directive changes the error
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar message displayed when <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> encounters an
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar error. For production servers you may consider changing the default
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar error message to <code>"<!-- Error -->"</code> so that
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the message is not presented to the user.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This directive has the same effect as the <code><!--#config
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">SSIErrorMsg "<!-- Error -->"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSIETag" id="SSIETag">SSIETag</a> <a name="ssietag" id="ssietag">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls whether ETags are generated by the server.</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIETag on|off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIETag off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Under normal circumstances, a file filtered by <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar may contain elements that are either dynamically generated, or that may
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar have changed independently of the original file. As a result, by default
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the server is asked not to generate an <code>ETag</code> header for the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar response by adding <code>no-etag</code> to the request notes.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code class="directive">SSIETag</code> directive suppresses this
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar behaviour, and allows the server to generate an <code>ETag</code> header.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar This can be used to enable caching of the output. Note that a backend server
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar or dynamic content generator may generate an ETag of its own, ignoring
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> regardless of the value of this setting.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="directive">SSIETag</code> can take on the following values:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd><code>no-etag</code> will be added to the request notes, and the server
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar is asked not to generate an ETag. Where a server ignores the value of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>no-etag</code> and generates an ETag anyway, the ETag will be
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar respected.</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>Existing ETags will be respected, and ETags generated by the server will
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar be passed on in the response.</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSILastModified" id="SSILastModified">SSILastModified</a> <a name="ssilastmodified" id="ssilastmodified">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls whether <code>Last-Modified</code> headers are generated by the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSILastModified on|off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSILastModified off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Under normal circumstances, a file filtered by <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar may contain elements that are either dynamically generated, or that may
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar have changed independently of the original file. As a result, by default
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the <code>Last-Modified</code> header is stripped from the response.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code class="directive">SSILastModified</code> directive overrides this
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar behaviour, and allows the <code>Last-Modified</code> header to be respected
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar if already present, or set if the header is not already present. This can
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar be used to enable caching of the output. <code class="directive">SSILastModified</code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar can take on the following values:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>The <code>Last-Modified</code> header will be stripped from responses,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar unless the <code class="directive"><a href="#xbithack">XBitHack</a></code> directive
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>The <code>Last-Modified</code> header will be respected if already
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar present in a response, and added to the response if the response is a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar file and the header is missing. The
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="directive"><a href="#ssilastmodified">SSILastModified</a></code> directive
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar takes precedence over <code class="directive"><a href="#xbithack">XBitHack</a></code>.</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSILegacyExprParser" id="SSILegacyExprParser">SSILegacyExprParser</a> <a name="ssilegacyexprparser" id="ssilegacyexprparser">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable compatibility mode for conditional expressions.</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSILegacyExprParser on|off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSILegacyExprParser off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.3.13 and later.</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>As of version 2.3.13, <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> has switched to the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar new <a href="/expr.html">ap_expr</a> syntax for conditional expressions
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar in <code>#if</code> flow control elements. This directive allows to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar switch to the <a href="#legacyexpr">old syntax</a> which is compatible
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar with Apache HTTPD version 2.2.x and earlier.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSIStartTag" id="SSIStartTag">SSIStartTag</a> <a name="ssistarttag" id="ssistarttag">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String that starts an include element</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIStartTag <var>tag</var></code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIStartTag "<!--#"</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This directive changes the string that <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar looks for to mark an include element to process.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>You may want to use this option if you have 2 servers parsing the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar output of a file each processing different commands (possibly at
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar different times).</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config"> SSIStartTag "<%"<br />
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar SSIEndTag "%>"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The example given above, which also specifies a matching
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="directive"><a href="#ssiendtag">SSIEndTag</a></code>, will
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar allow you to use SSI directives as shown in the example
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar below:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <div class="example"><h3>SSI directives with alternate start and end tags</h3><p><code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <%printenv %>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<li><code class="directive"><a href="#ssiendtag">SSIEndTag</a></code></li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSITimeFormat" id="SSITimeFormat">SSITimeFormat</a> <a name="ssitimeformat" id="ssitimeformat">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the format in which date strings are
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSITimeFormat <var>formatstring</var></code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSITimeFormat "%A, %d-%b-%Y %H:%M:%S %Z"</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<p>This directive changes the format in which date strings are displayed
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar when echoing <code>DATE</code> environment variables. The
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <var>formatstring</var> is as in <code>strftime(3)</code> from the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar C standard library.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This directive has the same effect as the <code><!--#config
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar timefmt=<var>formatstring</var> --></code> element.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">SSITimeFormat "%R, %B %d, %Y"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The above directive would cause times to be displayed in the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar format "22:26, June 14, 2002".</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="SSIUndefinedEcho" id="SSIUndefinedEcho">SSIUndefinedEcho</a> <a name="ssiundefinedecho" id="ssiundefinedecho">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String displayed when an unset variable is echoed</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIUndefinedEcho <var>string</var></code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIUndefinedEcho "(none)"</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>This directive changes the string that <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar displays when a variable is not set and "echoed".</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">SSIUndefinedEcho "<!-- undef -->"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="XBitHack" id="XBitHack">XBitHack</a> <a name="xbithack" id="xbithack">Directive</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Parse SSI directives in files with the execute bit
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>XBitHack on|off|full</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>XBitHack off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code class="directive">XBitHack</code> directive controls the parsing
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar of ordinary html documents. This directive only affects files associated
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar with the <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME-type</a> <code>text/html</code>. <code class="directive">XBitHack</code> can take on the following values:</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>Any <code>text/html</code> file that has the user-execute bit
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar set will be treated as a server-parsed html document.</dd>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <dd>As for <code>on</code> but also test the group-execute bit.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar If it is set, then set the <code>Last-modified</code> date of the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar returned file to be the last modified time of the file. If
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar it is not set, then no last-modified date is sent. Setting
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar this bit allows clients and proxies to cache the result of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the request.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>You would not want to use the full option, unless you assure the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar group-execute bit is unset for every SSI script which might <code>#include</code> a CGI or otherwise produces different output on
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar each hit (or could potentially change on subsequent requests).</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>The <code class="directive"><a href="#ssilastmodified">SSILastModified</a></code>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar directive takes precedence over the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="directive"><a href="#xbithack">XBitHack</a></code> directive when
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="directive"><a href="#ssilastmodified">SSILastModified</a></code> is set to
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<p><span>Available Languages: </span><a href="/en/mod/mod_include.html" title="English"> en </a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/ja/mod/mod_include.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
727872d18412fc021f03969b8641810d8896820bhumbedooh</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
727872d18412fc021f03969b8641810d8896820bhumbedoohvar comments_shortname = 'httpd';
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedoohvar comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_include.html';
0d0ba3a410038e179b695446bb149cce6264e0abnd(function(w, d) {
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread"><\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd var s = d.createElement('script');
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
0d0ba3a410038e179b695446bb149cce6264e0abnd (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd})(window, document);
205f749042ed530040a4f0080dbcb47ceae8a374rjung<p class="apache">Copyright 2015 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
0d0ba3a410038e179b695446bb149cce6264e0abndif (typeof(prettyPrint) !== 'undefined') {
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd prettyPrint();