github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/manual/mod/mod_include.html.en (about)

     1  <?xml version="1.0" encoding="ISO-8859-1"?>
     2  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     3  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
     4  <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
     5  <!--
     6          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     7                This file is generated from xml source: DO NOT EDIT
     8          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     9        -->
    10  <title>mod_include - Apache HTTP Server Version 2.2</title>
    11  <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
    12  <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
    13  <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" />
    14  <script src="../style/scripts/prettify.min.js" type="text/javascript">
    15  </script>
    16  
    17  <link href="../images/favicon.ico" rel="shortcut icon" /><link href="http://httpd.apache.org/docs/current/mod/mod_include.html" rel="canonical" /></head>
    18  <body>
    19  <div id="page-header">
    20  <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.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>
    21  <p class="apache">Apache HTTP Server Version 2.2</p>
    22  <img alt="" src="../images/feather.gif" /></div>
    23  <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
    24  <div id="path">
    25  <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Modules</a></div>
    26  <div id="page-content">
    27  <div class="retired"><h4>Please note</h4>
    28              <p> This document refers to a legacy release (<strong>2.2</strong>) of Apache httpd. The active release (<strong>2.4</strong>) is documented <a href="http://httpd.apache.org/docs/current">here</a>. If you have not already upgraded, please follow <a href="http://httpd.apache.org/docs/current/upgrading.html">this link</a> for more information.</p>
    29          <p>You may follow <a href="http://httpd.apache.org/docs/current/mod/mod_include.html">this link</a> to go to the current version of this document.</p></div><div id="preamble"><h1>Apache Module mod_include</h1>
    30  <div class="toplang">
    31  <p><span>Available Languages: </span><a href="../en/mod/mod_include.html" title="English">&nbsp;en&nbsp;</a> |
    32  <a href="../ja/mod/mod_include.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
    33  </div>
    34  <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Server-parsed html documents (Server Side Includes)</td></tr>
    35  <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
    36  <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>include_module</td></tr>
    37  <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_include.c</td></tr>
    38  <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Implemented as an output filter since Apache
    39  2.0</td></tr></table>
    40  <h3>Summary</h3>
    41  
    42      <p>This module provides a filter which will process files
    43      before they are sent to the client. The processing is
    44      controlled by specially formatted SGML comments, referred to as
    45      <dfn>elements</dfn>. These elements allow conditional text, the
    46      inclusion of other files or programs, as well as the setting and
    47      printing of environment variables.</p>
    48  </div>
    49  <div id="quickview"><h3>Topics</h3>
    50  <ul id="topics">
    51  <li><img alt="" src="../images/down.gif" /> <a href="#enabling">Enabling Server-Side Includes</a></li>
    52  <li><img alt="" src="../images/down.gif" /> <a href="#pathinfo">PATH_INFO with Server Side Includes</a></li>
    53  <li><img alt="" src="../images/down.gif" /> <a href="#elements">Basic Elements</a></li>
    54  <li><img alt="" src="../images/down.gif" /> <a href="#includevars">Include Variables</a></li>
    55  <li><img alt="" src="../images/down.gif" /> <a href="#substitution">Variable Substitution</a></li>
    56  <li><img alt="" src="../images/down.gif" /> <a href="#flowctrl">Flow Control Elements</a></li>
    57  </ul><h3 class="directives">Directives</h3>
    58  <ul id="toc">
    59  <li><img alt="" src="../images/down.gif" /> <a href="#ssienableaccess">SSIEnableAccess</a></li>
    60  <li><img alt="" src="../images/down.gif" /> <a href="#ssiendtag">SSIEndTag</a></li>
    61  <li><img alt="" src="../images/down.gif" /> <a href="#ssierrormsg">SSIErrorMsg</a></li>
    62  <li><img alt="" src="../images/down.gif" /> <a href="#ssietag">SSIETag</a></li>
    63  <li><img alt="" src="../images/down.gif" /> <a href="#ssilastmodified">SSILastModified</a></li>
    64  <li><img alt="" src="../images/down.gif" /> <a href="#ssistarttag">SSIStartTag</a></li>
    65  <li><img alt="" src="../images/down.gif" /> <a href="#ssitimeformat">SSITimeFormat</a></li>
    66  <li><img alt="" src="../images/down.gif" /> <a href="#ssiundefinedecho">SSIUndefinedEcho</a></li>
    67  <li><img alt="" src="../images/down.gif" /> <a href="#xbithack">XBitHack</a></li>
    68  </ul>
    69  <h3>See also</h3>
    70  <ul class="seealso">
    71  <li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li>
    72  <li><code class="directive"><a href="../mod/core.html#acceptpathinfo">AcceptPathInfo</a></code></li>
    73  <li><a href="../filter.html">Filters</a></li>
    74  <li><a href="../howto/ssi.html">SSI Tutorial</a></li>
    75  </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
    76  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
    77  <div class="section">
    78  <h2><a name="enabling" id="enabling">Enabling Server-Side Includes</a></h2>
    79      
    80  
    81      <p>Server Side Includes are implemented by the
    82      <code>INCLUDES</code> <a href="../filter.html">filter</a>. If
    83      documents containing server-side include directives are given
    84      the extension .shtml, the following directives will make Apache
    85      parse them and assign the resulting document the mime type of
    86      <code>text/html</code>:</p>
    87  
    88      <div class="example"><p><code>
    89        AddType text/html .shtml<br />
    90        AddOutputFilter INCLUDES .shtml
    91      </code></p></div>
    92  
    93      <p>The following directive must be given for the directories
    94      containing the shtml files (typically in a
    95      <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code> section,
    96      but this directive is also valid in <code>.htaccess</code> files if
    97      <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> <code>Options</code>
    98      is set):</p>
    99  
   100      <div class="example"><p><code>
   101        Options +Includes
   102      </code></p></div>
   103  
   104      <p>For backwards compatibility, the <code>server-parsed</code>
   105      <a href="../handler.html">handler</a> also activates the
   106      INCLUDES filter. As well, Apache will activate the INCLUDES
   107      filter for any document with mime type
   108      <code>text/x-server-parsed-html</code> or
   109      <code>text/x-server-parsed-html3</code> (and the resulting
   110      output will have the mime type <code>text/html</code>).</p>
   111  
   112      <p>For more information, see our <a href="../howto/ssi.html">Tutorial on Server Side Includes</a>.</p>
   113  </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   114  <div class="section">
   115  <h2><a name="pathinfo" id="pathinfo">PATH_INFO with Server Side Includes</a></h2>
   116      
   117  
   118      <p>Files processed for server-side includes no longer accept
   119      requests with <code>PATH_INFO</code> (trailing pathname information)
   120      by default.  You can use the <code class="directive"><a href="../mod/core.html#acceptpathinfo">AcceptPathInfo</a></code> directive to
   121      configure the server to accept requests with <code>PATH_INFO</code>.</p>
   122  </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   123  <div class="section">
   124  <h2><a name="elements" id="elements">Basic Elements</a></h2>
   125      <p>The document is parsed as an HTML document, with special
   126      commands embedded as SGML comments. A command has the syntax: </p>
   127  
   128      <div class="example"><p><code>
   129        &lt;!--#<var>element</var> <var>attribute</var>=<var>value</var>
   130        <var>attribute</var>=<var>value</var> ... --&gt;
   131      </code></p></div>
   132  
   133      <p>The value will often be enclosed in double quotes, but single
   134      quotes (<code>'</code>) and backticks (<code>`</code>) are also
   135      possible. Many commands only allow a single attribute-value pair.
   136      Note that the comment terminator (<code>--&gt;</code>) should be
   137      preceded by whitespace to ensure that it isn't considered part of
   138      an SSI token. Note that the leading <code>&lt;!--#</code> is <em>one</em>
   139      token and may not contain any whitespaces.</p>
   140  
   141      <p>The allowed elements are listed in the following table:</p>
   142  
   143      <table class="bordered">
   144      <tr><th>Element</th><th>Description</th></tr>
   145      <tr><td><code><a href="#element.config">config</a></code></td>
   146          <td>configure output formats</td></tr>
   147      <tr><td><code><a href="#element.echo">echo</a></code></td>
   148          <td>print variables</td></tr>
   149      <tr><td><code><a href="#element.exec">exec</a></code></td>
   150          <td>execute external programs</td></tr>
   151      <tr><td><code><a href="#element.fsize">fsize</a></code></td>
   152          <td>print size of a file</td></tr>
   153      <tr><td><code><a href="#element.flastmod">flastmod</a></code></td>
   154          <td>print last modification time of a file</td></tr>
   155      <tr><td><code><a href="#element.include">include</a></code></td>
   156          <td>include a file</td></tr>
   157      <tr><td><code><a href="#element.printenv">printenv</a></code></td>
   158          <td>print all available variables</td></tr>
   159      <tr><td><code><a href="#element.set">set</a></code></td>
   160          <td>set a value of a variable</td></tr>
   161      </table>
   162  
   163      <p>SSI elements may be defined by modules other than
   164      <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
   165      <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>, and will only be available if this
   166      module is loaded.</p>
   167  
   168      <h3><a name="element.config" id="element.config">The config Element</a></h3>
   169        <p>This command controls various aspects of the parsing. The
   170        valid attributes are:</p>
   171  
   172        <dl>
   173        <dt><code>echomsg</code> (<em>Apache 2.1 and later</em>)</dt>
   174        <dd>The value is a message that is sent back to the
   175        client if the <code><a href="#element.echo">echo</a></code> element
   176        attempts to echo an undefined variable. This overrides any <code class="directive"><a href="#ssiundefinedecho">SSIUndefinedEcho</a></code> directives.</dd>
   177  
   178        <dt><code>errmsg</code></dt>
   179        <dd>The value is a message that is sent back to the
   180        client if an error occurs while parsing the
   181        document. This overrides any <code class="directive"><a href="#ssierrormsg">SSIErrorMsg</a></code> directives.</dd>
   182  
   183        <dt><code>sizefmt</code></dt>
   184        <dd>The value sets the format to be used when displaying
   185        the size of a file. Valid values are <code>bytes</code>
   186        for a count in bytes, or <code>abbrev</code> for a count
   187        in Kb or Mb as appropriate, for example a size of 1024 bytes
   188        will be printed as "1K".</dd>
   189  
   190        <dt><code>timefmt</code></dt>
   191        <dd>The value is a string to be used by the
   192        <code>strftime(3)</code> library routine when printing
   193        dates.</dd>
   194        </dl>
   195       
   196  
   197      <h3><a name="element.echo" id="element.echo">The echo Element</a></h3>
   198        <p>This command prints one of the <a href="#includevars">include
   199        variables</a> defined below. If the variable is unset, the result is
   200        determined by the <code class="directive"><a href="#ssiundefinedecho">SSIUndefinedEcho</a></code> directive. Any dates printed are
   201        subject to the currently configured <code>timefmt</code>.</p>
   202  
   203        <p>Attributes:</p> 
   204  
   205        <dl>
   206        <dt><code>var</code></dt>
   207        <dd>The value is the name of the variable to print.</dd>
   208  
   209        <dt><code>encoding</code></dt>
   210        <dd><p>Specifies how Apache should encode special characters
   211        contained in the variable before outputting them. If set
   212        to <code>none</code>, no encoding will be done. If set to
   213        <code>url</code>, then URL encoding (also known as %-encoding;
   214        this is appropriate for use within URLs in links, etc.) will be
   215        performed. At the start of an <code>echo</code> element,
   216        the default is set to <code>entity</code>, resulting in entity
   217        encoding (which is appropriate in the context of a block-level
   218        HTML element, <em>e.g.</em> a paragraph of text). This can be
   219        changed by adding an <code>encoding</code> attribute, which will
   220        remain in effect until the next <code>encoding</code> attribute
   221        is encountered or the element ends, whichever comes first.</p>
   222  
   223        <p>The <code>encoding</code> attribute must <em>precede</em> the
   224        corresponding <code>var</code> attribute to be effective, and 
   225        only special characters as defined in the ISO-8859-1 character
   226        encoding will be encoded. This encoding process may not have the
   227        desired result if a different character encoding is in use.</p>
   228  
   229        <div class="warning">
   230          In order to avoid cross-site scripting issues, you should
   231          <em>always</em> encode user supplied data.
   232        </div>
   233        </dd>
   234        </dl>
   235       
   236  
   237      <h3><a name="element.exec" id="element.exec">The exec Element</a></h3>
   238        <p>The <code>exec</code> command executes a given shell command or
   239        CGI script. It requires <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code> to be present
   240        in the server. If <code class="directive"><a href="../mod/core.html#options">Options</a></code>
   241        <code>IncludesNOEXEC</code> is set, this command is completely
   242        disabled. The valid attributes are:</p>
   243  
   244        <dl>
   245        <dt><code>cgi</code></dt>
   246        <dd><p>The value specifies a (%-encoded) URL-path to
   247        the CGI script. If the path does not begin with a slash (/),
   248        then it is taken to be relative to the current
   249        document. The document referenced by this path is
   250        invoked as a CGI script, even if the server would not
   251        normally recognize it as such. However, the directory
   252        containing the script must be enabled for CGI scripts
   253        (with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>
   254        or <code class="directive"><a href="../mod/core.html#options">Options</a></code>
   255        <code>ExecCGI</code>).</p>
   256  
   257        <p>The CGI script is given the <code>PATH_INFO</code> and query
   258        string (<code>QUERY_STRING</code>) of the original request from the
   259        client; these <em>cannot</em> be specified in the URL path. The
   260        include variables will be available to the script in addition to
   261        the standard <a href="mod_cgi.html">CGI</a> environment.</p>
   262  
   263        <div class="example"><h3>Example</h3><p><code>
   264          &lt;!--#exec cgi="/cgi-bin/example.cgi" --&gt;
   265        </code></p></div>
   266  
   267        <p>If the script returns a <code>Location:</code> header instead of
   268        output, then this will be translated into an HTML anchor.</p>
   269  
   270        <p>The <code><a href="#includevirtual">include virtual</a></code>
   271        element should be used in preference to <code>exec cgi</code>. In
   272        particular, if you need to pass additional arguments to a CGI program,
   273        using the query string, this cannot be done with <code>exec
   274        cgi</code>, but can be done with <code>include virtual</code>, as
   275        shown here:</p>
   276  
   277        <div class="example"><p><code>
   278          &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
   279        </code></p></div>
   280        </dd>
   281  
   282        <dt><code>cmd</code></dt>
   283        <dd><p>The server will execute the given string using
   284        <code>/bin/sh</code>. The <a href="#includevars">include variables</a> are available to the command, in addition
   285        to the usual set of CGI variables.</p>
   286  
   287        <p>The use of <code><a href="#includevirtual">#include virtual</a></code> is almost always prefered to using
   288        either <code>#exec cgi</code> or <code>#exec cmd</code>. The former
   289        (<code>#include virtual</code>) uses the standard Apache sub-request
   290        mechanism to include files or scripts. It is much better tested and
   291        maintained.</p>
   292  
   293        <p>In addition, on some platforms, like Win32, and on unix when
   294        using <a href="../suexec.html">suexec</a>, you cannot pass arguments
   295        to a command in an <code>exec</code> directive, or otherwise include
   296        spaces in the command. Thus, while the following will work under a
   297        non-suexec configuration on unix, it will not produce the desired
   298        result under Win32, or when running suexec:</p>
   299  
   300        <div class="example"><p><code>
   301          &lt;!--#exec cmd="perl /path/to/perlscript arg1 arg2" --&gt;
   302        </code></p></div>
   303        </dd>
   304        </dl>
   305       
   306  
   307      <h3><a name="element.fsize" id="element.fsize">The fsize Element</a></h3>
   308        <p>This command prints the size of the specified file, subject
   309        to the <code>sizefmt</code> format specification. Attributes:</p>
   310  
   311        <dl>
   312        <dt><code>file</code></dt>
   313        <dd>The value is a path relative to the directory
   314        containing the current document being parsed.</dd>
   315  
   316        <dt><code>virtual</code></dt>
   317        <dd>The value is a (%-encoded) URL-path. If it does not begin with
   318        a slash (/) then it is taken to be relative to the current document.
   319        Note, that this does <em>not</em> print the size of any CGI output,
   320        but the size of the CGI script itself.</dd>
   321        </dl>
   322       
   323  
   324      <h3><a name="element.flastmod" id="element.flastmod">The flastmod Element</a></h3>
   325        <p>This command prints the last modification date of the
   326        specified file, subject to the <code>timefmt</code> format
   327        specification. The attributes are the same as for the
   328        <code><a href="#element.fsize">fsize</a></code> command.</p>
   329       
   330  
   331      <h3><a name="element.include" id="element.include">The include Element</a></h3>
   332        <p>This command inserts the text of another document or file
   333        into the parsed file. Any included file is subject to the usual
   334        access control. If the directory containing the parsed file has
   335        <a href="core.html#options">Options</a>
   336        <code>IncludesNOEXEC</code> set, then only documents with a text
   337        <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a> (<code>text/plain</code>,
   338        <code>text/html</code> etc.) will be included. Otherwise CGI
   339        scripts are invoked as normal using the complete URL given in
   340        the command, including any query string.</p>
   341  
   342        <p>An attribute defines the location of the document; the
   343        inclusion is done for each attribute given to the include
   344        command. The valid attributes are:</p>
   345  
   346        <dl>
   347        <dt><code>file</code></dt>
   348        <dd>The value is a path relative to the directory
   349        containing the current document being parsed. It cannot
   350        contain <code>../</code>, nor can it be an absolute path.
   351        Therefore, you cannot include files that are outside of the
   352        document root, or above the current document in the directory
   353        structure. The <code>virtual</code> attribute should always be
   354        used in preference to this one.</dd>
   355  
   356        <dt><code><a id="includevirtual" name="includevirtual">virtual</a></code></dt>
   357        <dd><p>The value is a (%-encoded) URL-path. The URL cannot contain a
   358        scheme or hostname, only a path and an optional query string. If it
   359        does not begin with a slash (/) then it is taken to be relative to the
   360        current document.</p>
   361  
   362        <p>A URL is constructed from the attribute, and the output the
   363        server would return if the URL were accessed by the client is
   364        included in the parsed output. Thus included files can be nested.</p>
   365  
   366        <p>If the specified URL is a CGI program, the program will be
   367        executed and its output inserted in place of the directive in the
   368        parsed file. You may include a query string in a CGI url:</p>
   369       
   370        <div class="example"><p><code>
   371          &lt;!--#include virtual="/cgi-bin/example.cgi?argument=value" --&gt;
   372        </code></p></div>
   373             
   374        <p><code>include virtual</code> should be used in preference
   375        to <code>exec cgi</code> to include the output of CGI programs
   376        into an HTML document.</p>
   377        </dd>
   378        </dl>
   379       
   380  
   381      <h3><a name="element.printenv" id="element.printenv">The printenv Element</a></h3>
   382        <p>This prints out a listing of all existing variables and
   383        their values. Special characters are entity encoded (see the <code><a href="#element.echo">echo</a></code> element for details)
   384        before being output. There are no attributes.</p>
   385  
   386        <div class="example"><h3>Example</h3><p><code>
   387          &lt;!--#printenv --&gt;
   388        </code></p></div>
   389       
   390  
   391      <h3><a name="element.set" id="element.set">The set Element</a></h3>
   392        <p>This sets the value of a variable. Attributes:</p>
   393  
   394        <dl>
   395        <dt><code>var</code></dt>
   396        <dd>The name of the variable to set.</dd>
   397  
   398        <dt><code>value</code></dt>
   399        <dd>The value to give a variable.</dd>
   400        </dl>
   401  
   402        <div class="example"><h3>Example</h3><p><code>
   403          &lt;!--#set var="category" value="help" --&gt;
   404        </code></p></div>
   405       
   406  </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   407  <div class="section">
   408  <h2><a name="includevars" id="includevars">Include Variables</a></h2>
   409      
   410  
   411      <p>In addition to the variables in the standard CGI environment,
   412      these are available for the <code>echo</code> command, for
   413      <code>if</code> and <code>elif</code>, and to any program
   414      invoked by the document.</p>
   415  
   416      <dl>
   417        <dt><code>DATE_GMT</code></dt>
   418        <dd>The current date in Greenwich Mean Time.</dd>
   419  
   420        <dt><code>DATE_LOCAL</code></dt>
   421        <dd>The current date in the local time zone.</dd>
   422  
   423        <dt><code>DOCUMENT_NAME</code></dt>
   424        <dd>The filename (excluding directories) of the document
   425        requested by the user.</dd>
   426  
   427        <dt><code>DOCUMENT_URI</code></dt>
   428        <dd>The (%-decoded) URL path of the document requested by the
   429        user. Note that in the case of nested include files, this is
   430        <em>not</em> the URL for the current document.  Note also that
   431        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
   432        URL is shown.</dd>
   433  
   434        <dt><code>LAST_MODIFIED</code></dt>
   435        <dd>The last modification date of the document requested by
   436        the user.</dd>
   437  
   438        <dt><code>QUERY_STRING_UNESCAPED</code></dt>
   439        <dd>If a query string is present, this variable contains the
   440        (%-decoded) query string, which is <em>escaped</em> for shell
   441        usage (special characters like <code>&amp;</code> etc. are
   442        preceded by backslashes).</dd>
   443      </dl>
   444  </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   445  <div class="section">
   446  <h2><a name="substitution" id="substitution">Variable Substitution</a></h2>
   447  
   448      <p>Variable substitution is done within quoted strings in most
   449      cases where they may reasonably occur as an argument to an SSI
   450      directive. This includes the <code>config</code>,
   451      <code>exec</code>, <code>flastmod</code>, <code>fsize</code>,
   452      <code>include</code>, <code>echo</code>, and <code>set</code>
   453      directives, as well as the arguments to conditional operators.
   454      You can insert a literal dollar sign into the string using backslash
   455      quoting:</p>
   456  
   457      <div class="example"><p><code>
   458        &lt;!--#if expr="$a = \$test" --&gt;
   459      </code></p></div>
   460  
   461      <p>If a variable reference needs to be substituted in the
   462      middle of a character sequence that might otherwise be
   463      considered a valid identifier in its own right, it can be
   464      disambiguated by enclosing the reference in braces,
   465      <em>a la</em> shell substitution:</p>
   466  
   467      <div class="example"><p><code>
   468        &lt;!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" --&gt;
   469      </code></p></div>
   470  
   471      <p>This will result in the <code>Zed</code> variable being set
   472      to "<code>X_Y</code>" if <code>REMOTE_HOST</code> is
   473      "<code>X</code>" and <code>REQUEST_METHOD</code> is
   474      "<code>Y</code>".</p>
   475  
   476      <p>The below example will print "in foo" if the
   477      <code>DOCUMENT_URI</code> is <code>/foo/file.html</code>, "in bar"
   478      if it is <code>/bar/file.html</code> and "in neither" otherwise:</p>
   479  
   480      <div class="example"><p><code>
   481        &lt;!--#if expr='"$DOCUMENT_URI" = "/foo/file.html"' --&gt;<br />
   482        <span class="indent">
   483          in foo<br />
   484        </span>
   485        &lt;!--#elif expr='"$DOCUMENT_URI" = "/bar/file.html"' --&gt;<br />
   486        <span class="indent">
   487          in bar<br />
   488        </span>
   489        &lt;!--#else --&gt;<br />
   490        <span class="indent">
   491          in neither<br />
   492        </span>
   493        &lt;!--#endif --&gt;
   494      </code></p></div>
   495  </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   496  <div class="section">
   497  <h2><a name="flowctrl" id="flowctrl">Flow Control Elements</a></h2>
   498      
   499  
   500      <p>The basic flow control elements are:</p>
   501  
   502      <div class="example"><p><code>
   503        &lt;!--#if expr="<var>test_condition</var>" --&gt;<br />
   504        &lt;!--#elif expr="<var>test_condition</var>" --&gt;<br />
   505        &lt;!--#else --&gt;<br />
   506        &lt;!--#endif --&gt;
   507      </code></p></div>
   508  
   509      <p>The <code>if</code> element works like an if statement in a
   510      programming language. The test condition is evaluated and if
   511      the result is true, then the text until the next <code>elif</code>,
   512      <code>else</code> or <code>endif</code> element is included in the
   513      output stream.</p>
   514  
   515      <p>The <code>elif</code> or <code>else</code> statements are used
   516      to put text into the output stream if the original
   517      <var>test_condition</var> was false. These elements are optional.</p>
   518  
   519      <p>The <code>endif</code> element ends the <code>if</code> element
   520      and is required.</p>
   521  
   522      <p><var>test_condition</var> is one of the following:</p>
   523  
   524      <dl>
   525        <dt><code><var>string</var></code></dt>
   526        <dd>true if <var>string</var> is not empty</dd>
   527  
   528        <dt><code><var>-A string</var></code></dt>
   529        <dd><p>true if the URL represented by the string is accessible by
   530        configuration, false otherwise. This test only has an effect if
   531        <code class="directive">SSIEnableAccess</code> is on. This is useful
   532        where content on a page is to be hidden from users who are not
   533        authorized to view the URL, such as a link to that URL. Note
   534        that the URL is only tested for whether access would be granted,
   535        not whether the URL exists.</p>
   536  
   537        <div class="example"><h3>Example</h3><p><code>
   538          &lt;!--#if expr="-A /private" --&gt;<br />
   539          <span class="indent">
   540            Click &lt;a href="/private"&gt;here&lt;/a&gt; to access private
   541            information.<br />
   542          </span>
   543          &lt;!--#endif --&gt;
   544        </code></p></div>
   545        </dd>
   546  
   547        <dt><code><var>string1</var> = <var>string2</var><br />
   548        <var>string1</var> == <var>string2</var><br />
   549        <var>string1</var> != <var>string2</var></code></dt>
   550        
   551        <dd><p>Compare <var>string1</var> with <var>string2</var>. If
   552        <var>string2</var> has the form <code>/<var>string2</var>/</code>
   553        then it is treated as a regular expression. Regular expressions are
   554        implemented by the <a href="http://www.pcre.org">PCRE</a> engine and
   555        have the same syntax as those in <a href="http://www.perl.com">perl
   556        5</a>. Note that <code>==</code> is just an alias for <code>=</code>
   557        and behaves exactly the same way.</p>
   558  
   559        <p>If you are matching positive (<code>=</code> or <code>==</code>), you
   560        can capture grouped parts of the regular expression. The captured parts
   561        are stored in the special variables <code>$1</code> ..
   562        <code>$9</code>.</p>
   563  
   564        <div class="example"><h3>Example</h3><p><code>
   565          &lt;!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" --&gt;<br />
   566          <span class="indent">
   567            &lt;!--#set var="session" value="$1" --&gt;<br />
   568          </span>
   569          &lt;!--#endif --&gt;
   570        </code></p></div>
   571        </dd>
   572  
   573        <dt><code><var>string1</var> &lt; <var>string2</var><br />
   574         <var>string1</var> &lt;= <var>string2</var><br />
   575         <var>string1</var> &gt; <var>string2</var><br />
   576         <var>string1</var> &gt;= <var>string2</var></code></dt>
   577  
   578        <dd>Compare <var>string1</var> with <var>string2</var>. Note, that
   579        strings are compared <em>literally</em> (using
   580        <code>strcmp(3)</code>). Therefore the string "100" is less than
   581        "20".</dd>
   582  
   583        <dt><code>( <var>test_condition</var> )</code></dt>
   584        <dd>true if <var>test_condition</var> is true</dd>
   585  
   586        <dt><code>! <var>test_condition</var></code></dt>
   587        <dd>true if <var>test_condition</var> is false</dd>
   588  
   589        <dt><code><var>test_condition1</var> &amp;&amp;
   590          <var>test_condition2</var></code></dt>
   591        <dd>true if both <var>test_condition1</var> and
   592        <var>test_condition2</var> are true</dd>
   593  
   594        <dt><code><var>test_condition1</var> ||
   595          <var>test_condition2</var></code></dt>
   596        <dd>true if either <var>test_condition1</var> or
   597        <var>test_condition2</var> is true</dd>
   598      </dl>
   599  
   600      <p>"<code>=</code>" and "<code>!=</code>" bind more tightly than
   601      "<code>&amp;&amp;</code>" and "<code>||</code>". "<code>!</code>" binds
   602      most tightly. Thus, the following are equivalent:</p>
   603  
   604      <div class="example"><p><code>
   605        &lt;!--#if expr="$a = test1 &amp;&amp; $b = test2" --&gt;<br />
   606        &lt;!--#if expr="($a = test1) &amp;&amp; ($b = test2)" --&gt;
   607      </code></p></div>
   608  
   609      <p>The boolean operators <code>&amp;&amp;</code> and <code>||</code>
   610      share the same priority. So if you want to bind such an operator more
   611      tightly, you should use parentheses.</p>
   612  
   613      <p>Anything that's not recognized as a variable or an operator
   614      is treated as a string. Strings can also be quoted:
   615      <code>'string'</code>. Unquoted strings can't contain whitespace
   616      (blanks and tabs) because it is used to separate tokens such as
   617      variables. If multiple strings are found in a row, they are
   618      concatenated using blanks. So,</p>
   619  
   620      <div class="example"><p><code><var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var>string2</var></code> results in <code><var>string1</var>&nbsp;<var>string2</var></code><br />
   621        <br />
   622        and<br />
   623        <br />
   624        <code>'<var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var>string2</var>'</code> results in <code><var>string1</var>&nbsp;&nbsp;&nbsp;&nbsp;<var>string2</var></code>.</p></div>
   625  
   626      <div class="note"><h3>Optimization of Boolean Expressions</h3>
   627        <p>If the expressions become more complex and slow down processing
   628        significantly, you can try to optimize them according to the
   629        evaluation rules:</p>
   630        <ul>
   631        <li>Expressions are evaluated from left to right</li>
   632        <li>Binary boolean operators (<code>&amp;&amp;</code> and <code>||</code>)
   633            are short circuited wherever possible. In conclusion with the rule
   634            above that means, <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> evaluates at first
   635            the left expression. If the left result is sufficient to determine
   636            the end result, processing stops here. Otherwise it evaluates the
   637            right side and computes the end result from both left and right
   638            results.</li>
   639        <li>Short circuit evaluation is turned off as long as there are regular
   640            expressions to deal with. These must be evaluated to fill in the
   641            backreference variables (<code>$1</code> .. <code>$9</code>).</li>
   642        </ul>
   643        <p>If you want to look how a particular expression is handled, you can
   644        recompile <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> using the
   645        <code>-DDEBUG_INCLUDE</code> compiler option. This inserts for every
   646        parsed expression tokenizer information, the parse tree and how it is
   647        evaluated into the output sent to the client.</p>
   648      </div>
   649  
   650      <div class="note"><h3>Escaping slashes in regex strings</h3>
   651       <p>All slashes which are not intended to act as delimiters in your regex must
   652       be escaped.  This is regardless of their meaning to the regex engine.</p>
   653      </div>
   654  </div>
   655  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   656  <div class="directive-section"><h2><a name="SSIEnableAccess" id="SSIEnableAccess">SSIEnableAccess</a> <a name="ssienableaccess" id="ssienableaccess">Directive</a></h2>
   657  <table class="directive">
   658  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the -A flag during conditional flow control processing.</td></tr>
   659  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIEnableAccess on|off</code></td></tr>
   660  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIEnableAccess off</code></td></tr>
   661  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
   662  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   663  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   664  </table>
   665      <p>The <code class="directive">SSIEnableAccess</code> directive controls whether
   666      the -A test is enabled during conditional flow control processing.
   667      <code class="directive">SSIEnableAccess</code> can take on the following values:</p>
   668  
   669      <dl>
   670  
   671        <dt><code>off</code></dt>
   672        <dd>&lt;!--#if expr="-A /foo"--&gt; will be interpreted as a series
   673        of string and regular expression tokens, the -A has no special
   674        meaning.</dd>
   675  
   676        <dt><code>on</code></dt>
   677        <dd>&lt;!--#if expr="-A /foo"--&gt; will evaluate to false if the
   678        URL /foo is inaccessible by configuration, or true otherwise.</dd>
   679  
   680      </dl>
   681  
   682  
   683  </div>
   684  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   685  <div class="directive-section"><h2><a name="SSIEndTag" id="SSIEndTag">SSIEndTag</a> <a name="ssiendtag" id="ssiendtag">Directive</a></h2>
   686  <table class="directive">
   687  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String that ends an include element</td></tr>
   688  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIEndTag <var>tag</var></code></td></tr>
   689  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIEndTag "--&gt;"</code></td></tr>
   690  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
   691  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   692  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   693  <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
   694  </table>
   695      <p>This directive changes the string that <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
   696      looks for to mark the end of an include element.</p>
   697  
   698      <div class="example"><h3>Example</h3><p><code>
   699        SSIEndTag "%&gt;"
   700      </code></p></div>
   701  
   702  
   703  <h3>See also</h3>
   704  <ul>
   705  <li><code class="directive"><a href="#ssistarttag">SSIStartTag</a></code></li>
   706  </ul>
   707  </div>
   708  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   709  <div class="directive-section"><h2><a name="SSIErrorMsg" id="SSIErrorMsg">SSIErrorMsg</a> <a name="ssierrormsg" id="ssierrormsg">Directive</a></h2>
   710  <table class="directive">
   711  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Error message displayed when there is an SSI
   712  error</td></tr>
   713  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIErrorMsg <var>message</var></code></td></tr>
   714  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIErrorMsg "[an error occurred while processing this
   715  directive]"</code></td></tr>
   716  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
   717  <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
   718  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   719  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   720  <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
   721  </table>
   722      <p>The <code class="directive">SSIErrorMsg</code> directive changes the error
   723      message displayed when <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> encounters an
   724      error. For production servers you may consider changing the default
   725      error message to <code>"&lt;!-- Error --&gt;"</code> so that
   726      the message is not presented to the user.</p>
   727  
   728      <p>This directive has the same effect as the <code>&lt;!--#config
   729      errmsg=<var>message</var> --&gt;</code> element.</p>
   730  
   731      <div class="example"><h3>Example</h3><p><code>
   732        SSIErrorMsg "&lt;!-- Error --&gt;"
   733      </code></p></div>
   734  
   735  </div>
   736  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   737  <div class="directive-section"><h2><a name="SSIETag" id="SSIETag">SSIETag</a> <a name="ssietag" id="ssietag">Directive</a></h2>
   738  <table class="directive">
   739  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls whether ETags are generated by the server.</td></tr>
   740  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIETag on|off</code></td></tr>
   741  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIETag off</code></td></tr>
   742  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
   743  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   744  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   745  <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2.15 and later.</td></tr>
   746  </table>
   747        <p>Under normal circumstances, a file filtered by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
   748          may contain elements that are either dynamically generated, or that may
   749          have changed independently of the original file. As a result, by default
   750          the server is asked not to generate an <code>ETag</code> header for the
   751          response by adding <code>no-etag</code> to the request notes.</p>
   752  
   753        <p>The <code class="directive">SSIETag</code> directive suppresses this
   754          behaviour, and allows the server to generate an <code>ETag</code> header.
   755          This can be used to enable caching of the output. Note that a backend server
   756          or dynamic content generator may generate an ETag of its own, ignoring
   757          <code>no-etag</code>, and this ETag will be passed by
   758          <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> regardless of the value of this setting.
   759          <code class="directive">SSIETag</code> can take on the following values:</p>
   760  
   761        <dl>
   762  
   763          <dt><code>off</code></dt>
   764          <dd><code>no-etag</code> will be added to the request notes, and the server
   765            is asked not to generate an ETag. Where a server ignores the value of
   766            <code>no-etag</code> and generates an ETag anyway, the ETag will be
   767            respected.</dd>
   768  
   769          <dt><code>on</code></dt>
   770          <dd>Existing ETags will be respected, and ETags generated by the server will
   771            be passed on in the response.</dd>
   772  
   773        </dl>
   774  
   775  
   776  </div>
   777  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   778  <div class="directive-section"><h2><a name="SSILastModified" id="SSILastModified">SSILastModified</a> <a name="ssilastmodified" id="ssilastmodified">Directive</a></h2>
   779  <table class="directive">
   780  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls whether <code>Last-Modified</code> headers are generated by the
   781  server.</td></tr>
   782  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSILastModified on|off</code></td></tr>
   783  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSILastModified off</code></td></tr>
   784  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
   785  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   786  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   787  <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2.15 and later.</td></tr>
   788  </table>
   789        <p>Under normal circumstances, a file filtered by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
   790          may contain elements that are either dynamically generated, or that may
   791          have changed independently of the original file. As a result, by default
   792          the <code>Last-Modified</code> header is stripped from the response.</p>
   793  
   794        <p>The <code class="directive">SSILastModified</code> directive overrides this
   795          behaviour, and allows the <code>Last-Modified</code> header to be respected
   796          if already present, or set if the header is not already present. This can
   797          be used to enable caching of the output. <code class="directive">SSILastModified</code>
   798          can take on the following values:</p>
   799        
   800        <dl>
   801          
   802          <dt><code>off</code></dt>
   803          <dd>The <code>Last-Modified</code> header will be stripped from responses,
   804            unless the <code class="directive"><a href="#xbithack">XBitHack</a></code> directive
   805            is set to <code>full</code> as described below.</dd>
   806          
   807          <dt><code>on</code></dt>
   808          <dd>The <code>Last-Modified</code> header will be respected if already
   809            present in a response, and added to the response if the response is a
   810            file and the header is missing. The
   811            <code class="directive"><a href="#ssilastmodified">SSILastModified</a></code> directive
   812            takes precedence over <code class="directive"><a href="#xbithack">XBitHack</a></code>.</dd>
   813          
   814        </dl>
   815        
   816  
   817  </div>
   818  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   819  <div class="directive-section"><h2><a name="SSIStartTag" id="SSIStartTag">SSIStartTag</a> <a name="ssistarttag" id="ssistarttag">Directive</a></h2>
   820  <table class="directive">
   821  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String that starts an include element</td></tr>
   822  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIStartTag <var>tag</var></code></td></tr>
   823  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIStartTag "&lt;!--#"</code></td></tr>
   824  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
   825  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   826  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   827  <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
   828  </table>
   829      <p>This directive changes the string that <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
   830      looks for to mark an include element to process.</p>
   831  
   832      <p>You may want to use this option if you have 2 servers parsing the
   833      output of a file each processing different commands (possibly at
   834      different times).</p> 
   835  
   836      <div class="example"><h3>Example</h3><p><code>
   837        SSIStartTag "&lt;%"<br />
   838        SSIEndTag   "%&gt;"
   839      </code></p></div>
   840  
   841      <p>The example given above, which also specifies a matching
   842      <code class="directive"><a href="#ssiendtag">SSIEndTag</a></code>, will 
   843      allow you to use SSI directives as shown in the example 
   844      below:</p>
   845  
   846      <div class="example"><h3>SSI directives with alternate start and end tags</h3><p><code>
   847        &lt;%printenv %&gt;
   848      </code></p></div>
   849  
   850  <h3>See also</h3>
   851  <ul>
   852  <li><code class="directive"><a href="#ssiendtag">SSIEndTag</a></code></li>
   853  </ul>
   854  </div>
   855  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   856  <div class="directive-section"><h2><a name="SSITimeFormat" id="SSITimeFormat">SSITimeFormat</a> <a name="ssitimeformat" id="ssitimeformat">Directive</a></h2>
   857  <table class="directive">
   858  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the format in which date strings are
   859  displayed</td></tr>
   860  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSITimeFormat <var>formatstring</var></code></td></tr>
   861  <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>
   862  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
   863  <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
   864  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   865  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   866  <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
   867  </table>
   868  <p>This directive changes the format in which date strings are displayed 
   869      when echoing <code>DATE</code> environment variables. The
   870      <var>formatstring</var> is as in <code>strftime(3)</code> from the
   871      C standard library.</p>
   872  
   873      <p>This directive has the same effect as the <code>&lt;!--#config
   874      timefmt=<var>formatstring</var> --&gt;</code> element.</p>
   875  
   876      <div class="example"><h3>Example</h3><p><code>
   877        SSITimeFormat "%R, %B %d, %Y"
   878      </code></p></div>
   879  
   880      <p>The above directive would cause times to be displayed in the
   881      format "22:26, June 14, 2002".</p>
   882  
   883  </div>
   884  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   885  <div class="directive-section"><h2><a name="SSIUndefinedEcho" id="SSIUndefinedEcho">SSIUndefinedEcho</a> <a name="ssiundefinedecho" id="ssiundefinedecho">Directive</a></h2>
   886  <table class="directive">
   887  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String displayed when an unset variable is echoed</td></tr>
   888  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIUndefinedEcho <var>string</var></code></td></tr>
   889  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIUndefinedEcho "(none)"</code></td></tr>
   890  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
   891  <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
   892  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   893  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   894  <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.34 and later.</td></tr>
   895  </table>
   896      <p>This directive changes the string that <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
   897      displays when a variable is not set and "echoed".</p>
   898  
   899      <div class="example"><h3>Example</h3><p><code>
   900        SSIUndefinedEcho "&lt;!-- undef --&gt;"
   901      </code></p></div>
   902  
   903  </div>
   904  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   905  <div class="directive-section"><h2><a name="XBitHack" id="XBitHack">XBitHack</a> <a name="xbithack" id="xbithack">Directive</a></h2>
   906  <table class="directive">
   907  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Parse SSI directives in files with the execute bit
   908  set</td></tr>
   909  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>XBitHack on|off|full</code></td></tr>
   910  <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>XBitHack off</code></td></tr>
   911  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
   912  <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
   913  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
   914  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
   915  </table>
   916      <p>The <code class="directive">XBitHack</code> directive controls the parsing
   917      of ordinary html documents. This directive only affects files associated
   918      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>
   919  
   920      <dl>
   921        <dt><code>off</code></dt>
   922        <dd>No special treatment of executable files.</dd>
   923  
   924        <dt><code>on</code></dt>
   925        <dd>Any <code>text/html</code> file that has the user-execute bit
   926        set will be treated as a server-parsed html document.</dd>
   927  
   928        <dt><code>full</code></dt>
   929        <dd>As for <code>on</code> but also test the group-execute bit.
   930        If it is set, then set the <code>Last-modified</code> date of the
   931        returned file to be the last modified time of the file. If
   932        it is not set, then no last-modified date is sent. Setting
   933        this bit allows clients and proxies to cache the result of
   934        the request. 
   935  
   936        <div class="note"><h3>Note</h3>
   937        <p>You would not want to use the full option, unless you assure the
   938        group-execute bit is unset for every SSI script which might <code>#include</code> a CGI or otherwise produces different output on
   939        each hit (or could potentially change on subsequent requests).</p>
   940        
   941        <p>The <code class="directive"><a href="#ssilastmodified">SSILastModified</a></code>
   942        directive takes precedence over the
   943        <code class="directive"><a href="#xbithack">XBitHack</a></code> directive when
   944        <code class="directive"><a href="#ssilastmodified">SSILastModified</a></code> is set to
   945        <code>on</code>.</p>
   946        </div>
   947  
   948        </dd>
   949      </dl>
   950  
   951  
   952  </div>
   953  </div>
   954  <div class="bottomlang">
   955  <p><span>Available Languages: </span><a href="../en/mod/mod_include.html" title="English">&nbsp;en&nbsp;</a> |
   956  <a href="../ja/mod/mod_include.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
   957  </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&amp;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>
   958  <script type="text/javascript"><!--//--><![CDATA[//><!--
   959  var comments_shortname = 'httpd';
   960  var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_include.html';
   961  (function(w, d) {
   962      if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
   963          d.write('<div id="comments_thread"><\/div>');
   964          var s = d.createElement('script');
   965          s.type = 'text/javascript';
   966          s.async = true;
   967          s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
   968          (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
   969      }
   970      else { 
   971          d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
   972      }
   973  })(window, document);
   974  //--><!]]></script></div><div id="footer">
   975  <p class="apache">Copyright 2017 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>
   976  <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.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[//><!--
   977  if (typeof(prettyPrint) !== 'undefined') {
   978      prettyPrint();
   979  }
   980  //--><!]]></script>
   981  </body></html>