📄 mod_include.html.en
字号:
implemented by the <a href="http://www.pcre.org">PCRE</a> engine and
have the same syntax as those in <a href="http://www.perl.com">perl
5</a>.</p>
<p>If you are matching positive (<code>=</code>), you can capture
grouped parts of the regular expression. The captured parts are
stored in the special variables <code>$1</code> ..
<code>$9</code>.</p>
<div class="example"><h3>Example</h3><p><code>
<!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" --><br />
<span class="indent">
<!--#set var="session" value="$1" --><br />
</span>
<!--#endif -->
</code></p></div>
</dd>
<dt><code><var>string1</var> < <var>string2</var><br />
<var>string1</var> <= <var>string2</var><br />
<var>string1</var> > <var>string2</var><br />
<var>string1</var> >= <var>string2</var></code></dt>
<dd>Compare <var>string1</var> with <var>string2</var>. Note, that
strings are compared <em>literally</em> (using
<code>strcmp(3)</code>). Therefore the string "100" is less than
"20".</dd>
<dt><code>( <var>test_condition</var> )</code></dt>
<dd>true if <var>test_condition</var> is true</dd>
<dt><code>! <var>test_condition</var></code></dt>
<dd>true if <var>test_condition</var> is false</dd>
<dt><code><var>test_condition1</var> &&
<var>test_condition2</var></code></dt>
<dd>true if both <var>test_condition1</var> and
<var>test_condition2</var> are true</dd>
<dt><code><var>test_condition1</var> ||
<var>test_condition2</var></code></dt>
<dd>true if either <var>test_condition1</var> or
<var>test_condition2</var> is true</dd>
</dl>
<p>"<code>=</code>" and "<code>!=</code>" bind more tightly than
"<code>&&</code>" and "<code>||</code>". "<code>!</code>" binds
most tightly. Thus, the following are equivalent:</p>
<div class="example"><p><code>
<!--#if expr="$a = test1 && $b = test2" --><br />
<!--#if expr="($a = test1) && ($b = test2)" -->
</code></p></div>
<p>The boolean operators <code>&&</code> and <code>||</code>
share the same priority. So if you want to bind such an operator more
tightly, you should use parentheses.</p>
<p>Anything that's not recognized as a variable or an operator
is treated as a string. Strings can also be quoted:
<code>'string'</code>. Unquoted strings can't contain whitespace
(blanks and tabs) because it is used to separate tokens such as
variables. If multiple strings are found in a row, they are
concatenated using blanks. So,</p>
<div class="example"><p><code><var>string1</var> <var>string2</var></code> results in <code><var>string1</var> <var>string2</var></code><br />
<br />
and<br />
<br />
<code>'<var>string1</var> <var>string2</var>'</code> results in <code><var>string1</var> <var>string2</var></code>.</p></div>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SSIEndTag" id="SSIEndTag">SSIEndTag</a> <a name="ssiendtag" id="ssiendtag">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String that ends an include element</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIEndTag <var>tag</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIEndTag "-->"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
</table>
<p>This directive changes the string that <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
looks for to mark the end of an include element.</p>
<div class="example"><h3>Example</h3><p><code>
SSIEndTag "%>"
</code></p></div>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#ssistarttag">SSIStartTag</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SSIErrorMsg" id="SSIErrorMsg">SSIErrorMsg</a> <a name="ssierrormsg" id="ssierrormsg">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Error message displayed when there is an SSI
error</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIErrorMsg <var>message</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIErrorMsg "[an error occurred while processing this
directive]"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
</table>
<p>The <code class="directive">SSIErrorMsg</code> directive changes the error
message displayed when <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> encounters an
error. For production servers you may consider changing the default
error message to <code>"<!-- Error -->"</code> so that
the message is not presented to the user.</p>
<p>This directive has the same effect as the <code><!--#config
errmsg=<var>message</var> --></code> element.</p>
<div class="example"><h3>Example</h3><p><code>
SSIErrorMsg "<!-- Error -->"
</code></p></div>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SSIStartTag" id="SSIStartTag">SSIStartTag</a> <a name="ssistarttag" id="ssistarttag">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String that starts an include element</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIStartTag <var>tag</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIStartTag "<!--#"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
</table>
<p>This directive changes the string that <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
looks for to mark an include element to process.</p>
<p>You may want to use this option if you have 2 servers parsing the
output of a file each processing different commands (possibly at
different times).</p>
<div class="example"><h3>Example</h3><p><code>
SSIStartTag "<%"<br />
SSIEndTag "%>"
</code></p></div>
<p>The example given above, which also specifies a matching
<code class="directive"><a href="#ssiendtag">SSIEndTag</a></code>, will
allow you to use SSI directives as shown in the example
below:</p>
<div class="example"><h3>SSI directives with alternate start and end tags</h3><p><code>
<%printenv %>
</code></p></div>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#ssiendtag">SSIEndTag</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SSITimeFormat" id="SSITimeFormat">SSITimeFormat</a> <a name="ssitimeformat" id="ssitimeformat">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the format in which date strings are
displayed</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSITimeFormat <var>formatstring</var></code></td></tr>
<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>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
</table>
<p>This directive changes the format in which date strings are displayed
when echoing <code>DATE</code> environment variables. The
<var>formatstring</var> is as in <code>strftime(3)</code> from the
C standard library.</p>
<p>This directive has the same effect as the <code><!--#config
timefmt=<var>formatstring</var> --></code> element.</p>
<div class="example"><h3>Example</h3><p><code>
SSITimeFormat "%R, %B %d, %Y"
</code></p></div>
<p>The above directive would cause times to be displayed in the
format "22:26, June 14, 2002".</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SSIUndefinedEcho" id="SSIUndefinedEcho">SSIUndefinedEcho</a> <a name="ssiundefinedecho" id="ssiundefinedecho">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>String displayed when an unset variable is echoed</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SSIUndefinedEcho <var>string</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SSIUndefinedEcho "(none)"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.34 and later.</td></tr>
</table>
<p>This directive changes the string that <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
displays when a variable is not set and "echoed".</p>
<div class="example"><h3>Example</h3><p><code>
SSIUndefinedEcho "<!-- undef -->"
</code></p></div>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="XBitHack" id="XBitHack">XBitHack</a> <a name="xbithack" id="xbithack">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Parse SSI directives in files with the execute bit
set</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>XBitHack on|off|full</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>XBitHack off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_include</td></tr>
</table>
<p>The <code class="directive">XBitHack</code> directive controls the parsing
of ordinary html documents. This directive only affects files associated
with the MIME type <code>text/html</code>. <code class="directive">XBitHack</code> can take on the following values:</p>
<dl>
<dt><code>off</code></dt>
<dd>No special treatment of executable files.</dd>
<dt><code>on</code></dt>
<dd>Any <code>text/html</code> file that has the user-execute bit
set will be treated as a server-parsed html document.</dd>
<dt><code>full</code></dt>
<dd>As for <code>on</code> but also test the group-execute bit.
If it is set, then set the <code>Last-modified</code> date of the
returned file to be the last modified time of the file. If
it is not set, then no last-modified date is sent. Setting
this bit allows clients and proxies to cache the result of
the request.
<div class="note"><h3>Note</h3>
<p>You would not want to use the full option, unless you assure the
group-execute bit is unset for every SSI script which might <code>#include</code> a CGI or otherwise produces different output on
each hit (or could potentially change on subsequent requests).</p>
</div>
</dd>
</dl>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/mod/mod_include.html" title="English"> en </a> |
<a href="../ja/mod/mod_include.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
</div><div id="footer">
<p class="apache">Copyright 2006 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>
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -