📄 mod_include.html
字号:
"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>和<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>或<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>和<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 />和<br />
<br />
<code>'<var>string1</var> <var>string2</var>'</code> results in <code><var>string1</var> <var>string2</var></code>.</p></div>
<div class="note"><h3>Optimization of Boolean Expressions</h3>
<p>If the expressions become more complex and slow down processing
significantly, you can try to optimize them according to the
evaluation rules:</p>
<ul>
<li>Expressions are evaluated from left to right</li>
<li>Binary boolean operators (<code>&&</code>和<code>||</code>)
are short circuited wherever possible. In conclusion with the rule
above that means, <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> evaluates at first
the left expression. If the left result is sufficient to determine
the end result, processing stops here. Otherwise it evaluates the
right side and computes the end result from both left and right
results.</li>
<li>Short circuit evaluation is turned off as long as there are regular
expressions to deal with. These must be evaluated to fill in the
backreference variables (<code>$1</code> .. <code>$9</code>).</li>
</ul>
<p>If you want to look how a particular expression is handled, you can
recompile <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> using the
<code>-DDEBUG_INCLUDE</code> compiler option. This inserts for every
parsed expression tokenizer information, the parse tree and how it is
evaluated into the output sent to the client.</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">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>String that ends an include element</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>SSIEndTag <var>tag</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">默认值</a></th><td><code>SSIEndTag "-->"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">作用域</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">兼容性</a></th><td>仅在 Apache 2.0.30 及以后的版本中可用</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>示例</h3><p><code>
SSIEndTag "%>"
</code></p></div>
<h3>参见</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">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>Error message displayed when there is an SSI
error</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>SSIErrorMsg <var>message</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">默认值</a></th><td><code>SSIErrorMsg "[an error occurred while processing this
directive]"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">作用域</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">覆盖项</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">兼容性</a></th><td>仅在 Apache 2.0.30 及以后的版本中可用</td></tr>
</table>
<p><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>示例</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">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>String that starts an include element</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>SSIStartTag <var>tag</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">默认值</a></th><td><code>SSIStartTag "<!--#"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">作用域</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">兼容性</a></th><td>仅在 Apache 2.0.30 及以后的版本中可用</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>示例</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>参见</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">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>Configures the format in which date strings are
displayed</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>SSITimeFormat <var>formatstring</var></code></td></tr>
<tr><th><a href="directive-dict.html#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">作用域</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">覆盖项</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">兼容性</a></th><td>仅在 Apache 2.0.30 及以后的版本中可用</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>示例</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">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>String displayed when an unset variable is echoed</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>SSIUndefinedEcho <var>string</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">默认值</a></th><td><code>SSIUndefinedEcho "(none)"</code></td></tr>
<tr><th><a href="directive-dict.html#Context">作用域</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">覆盖项</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_include</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">兼容性</a></th><td>仅在 Apache 2.0.34 及以后的版本中可用</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>示例</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">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>Parse SSI directives in files with the execute bit
set</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>XBitHack on|off|full</code></td></tr>
<tr><th><a href="directive-dict.html#Default">默认值</a></th><td><code>XBitHack off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">作用域</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">覆盖项</a></th><td>Options</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_include</td></tr>
</table>
<p><code class="directive">XBitHack</code> directive controls the parsing
of ordinary html documents. This directive only affects files associated
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>
<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>注意</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 id="footer">
<p class="apache">本文允许自由使用、分发、转载,但必须保留译者署名;详见:<a href="../translator_announcement.html#announcement">译者声明</a>。</p>
<p class="menu"><a href="../mod/index.html">模块索引</a> | <a href="../mod/directives.html">指令索引</a> | <a href="../faq/index.html">常见问题</a> | <a href="../glossary.html">词汇表</a> | <a href="../sitemap.html">站点导航</a></p></div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -