<code>text/x-server-parsed-html3</code> (and the resulting
output will have the mime type <code>text/html</code>).</p>
- <p>For more information, see our <a
+ <seealso>For more information, see our <a
href="../howto/ssi.html">Tutorial on Server Side
- Includes</a>.</p>
+ Includes</a>.</seealso>
</section>
<section id="basic">
<dt><strong><a id="echo" name="echo">echo</a></strong></dt>
<dd>
- This command prints one of the <a href="#includevars">include
- variables</a>, defined
- below. If the variable is unset, it is printed as
- <code>(none)</code>. Any dates printed are subject to the
- currently configured <code>timefmt</code>. Attributes:
+ <p>This command prints one of the <a href="#includevars">include
+ variables</a>, defined below. If the variable is unset, it
+ is printed as <code>(none)</code>. Any dates printed are
+ subject to the currently configured <code>timefmt</code>.</p>
+
+ <p>Attributes:</p>
<dl>
<dt><strong>var</strong></dt>
<dd>
The exec command executes a given shell command or CGI
- script. The IncludesNOEXEC <a
- href="core.html#options">Option</a> disables this command
+ script. The IncludesNOEXEC <directive
+ module="core">Option</directive> disables this command
completely. The valid attributes are:
<dl>
invoked as a CGI script, even if the server would not
normally recognize it as such. However, the directory
containing the script must be enabled for CGI scripts
- (with <a
- href="mod_alias.html#scriptalias">ScriptAlias</a> or
- the ExecCGI <a href="core.html#options">Option</a>).
+ (with <directive module="mod_alias">ScriptAlias</directive>
+ or the ExecCGI <directive module="core">Option</directive>).
<p>The CGI script is given the PATH_INFO and query
string (QUERY_STRING) of the original request from the
<p>For example:</p>
- <code><!--#exec cgi="/cgi-bin/example.cgi" --></code>
+ <example><!--#exec cgi="/cgi-bin/example.cgi" --></example>
<p>If the script returns a Location: header instead of
output, then this will be translated into an HTML
cgi</code>, but can be done with <code>include
virtual</code>, as shown here:</p>
- <code><!--#include virtual="/cgi-bin/example.cgi?argument=value" --></code>
+ <example>
+ <!--#include virtual="/cgi-bin/example.cgi?argument=value" -->
+ </example>
+
</dd>
<dt><strong>cmd</strong></dt>
non-suexec configuration on unix, it will not produce the
desired result under Win32, or when running suexec:</p>
- <code><!--#exec cmd="perl /path/to/perlscript arg1 arg2" --></code>
+ <example>
+ <!--#exec cmd="perl /path/to/perlscript arg1 arg2" -->
+ </example>
</dd>
</dl>
in the parsed file. You may include a query string in a CGI
url:</p>
- <code><!--#include virtual="/cgi-bin/example.cgi?argument=value" --></code>
+ <example>
+ <!--#include virtual="/cgi-bin/example.cgi?argument=value" -->
+ </example>
<p><code>include virtual</code> should be used in preference
to <code>exec cgi</code> to include the output of CGI
<p>For example:</p>
- <p><code><!--#printenv --></code></p>
+ <example>
+ <!--#printenv -->
+ </example>
<p>The <strong>printenv</strong> element is available only in
Apache 1.2 and above.</p>
<dd>The value to give a variable.</dd>
</dl>
- <p>
- For example: <code><!--#set var="category" value="help"
- --></code></p>
+ <p>For example:</p>
+
+ <example>
+ <!--#set var="category" value="help" -->
+ </example>
<p>The <strong>set</strong> element is available only in
Apache 1.2 and above.</p>
as the arguments to conditional operators. You can insert a
literal dollar sign into the string using backslash
quoting:</p>
-<pre>
+<example>
<!--#if expr="$a = \$test" -->
-</pre>
+</example>
<p>If a variable reference needs to be substituted in the
middle of a character sequence that might otherwise be
considered a valid identifier in its own right, it can be
disambiguated by enclosing the reference in braces,
<em>a la</em> shell substitution:</p>
-<pre>
+
+<example>
<!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" -->
-</pre>
+</example>
<p>This will result in the <samp>Zed</samp> variable being set
to "<samp>X_Y</samp>" if <samp>REMOTE_HOST</samp> is
<p>EXAMPLE: the below example will print "in foo" if the
DOCUMENT_URI is /foo/file.html, "in bar" if it is
/bar/file.html and "in neither" otherwise:</p>
-<pre>
- <!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\"" -->
- in foo
- <!--#elif expr="\"$DOCUMENT_URI\" = \"/bar/file.html\"" -->
- in bar
- <!--#else -->
- in neither
+
+<example>
+ <!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\"" --><br />
+ in foo<br />
+ <!--#elif expr="\"$DOCUMENT_URI\" = \"/bar/file.html\"" --><br />
+ in bar<br />
+ <!--#else --><br />
+ in neither<br />
<!--#endif -->
-</pre>
+</example>
</section>
<section>
These are available in Apache 1.2 and above. The basic flow
control elements are:
-<pre>
- <!--#if expr="<em>test_condition</em>" -->
- <!--#elif expr="<em>test_condition</em>" -->
- <!--#else -->
+
+<example>
+ <!--#if expr="<em>test_condition</em>" --><br />
+ <!--#elif expr="<em>test_condition</em>" --><br />
+ <!--#else --><br />
<!--#endif -->
-</pre>
+</example>
<p>The <strong><code>if</code></strong> element works like an
if statement in a programming language. The test condition is
<p>"<em>=</em>" and "<em>!=</em>" bind more tightly than
"<em>&&</em>" and "<em>||</em>". "<em>!</em>" binds
most tightly. Thus, the following are equivalent:</p>
-<pre>
- <!--#if expr="$a = test1 && $b = test2" -->
+
+<example>
+ <!--#if expr="$a = test1 && $b = test2" --><br />
<!--#if expr="($a = test1) && ($b = test2)" -->
-</pre>
+</example>
<p>Anything that's not recognized as a variable or an operator
is treated as a string. Strings can also be quoted:
(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>
-<pre>
- <em>string1 string2</em> results in <em>string1 string2</em>
- <em>'string1 string2'</em> results in <em>string1 string2</em>
-</pre>
+
+<example>
+ <pre><em>string1 string2</em> results in <em>string1 string2</em></pre>
+ <pre><em>'string1 string2'</em> results in <em>string1 string2</em></pre>
+</example>
</section>
<p>Files processed for server-side includes no longer accept
requests with PATH_INFO (trailing pathname information) by
- default. You can use the <a
- href="core.html#AcceptPathInfo">AcceptPathInfo</a> directive to
+ default. You can use the <directive
+ module="code">AcceptPathInfo</directive> directive to
configure the server to accept requests with PATH_INFO.</p>
</section>
-
<directivesynopsis>
<name>SSIEndTag</name>
<description>Changes the string that mod_include looks for to end an
this bit allows clients and proxies to cache the result of
the request.
- <p><strong>Note:</strong> you would not want to use the full
+ <note><strong>Note:</strong> 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>
+ potentially change on subsequent requests).</note>
</dd>
</dl>