Server Side Includes

Server-side includes (SSIs) are simple, HTML-embedded directives that instruct Stronghold to execute a program or include data in the HTML document. As a shorthand alternative to CGI, server-side includes can be handy. However, like CGI, they should be used with caution and an eye for security risks.

Syntax and Directives

All SSI directives follow this format:

<!--#directive parameter="value"-->

Directives can have more than one parameter, and multiple parameters are separated by white space. The valid SSI directives are as follows:

Syntax: echo var="environment-variable"
Context: HTML
Echo inserts the value of one or more SSI environment variables.

Syntax: include file|virtual="path"
Context: HTML
The include directive inserts the text of another document, specified either as a file or a virtual file. Path must be relative to the current document in the case of a file, or it can be a virtual path. For example:

<!--#include file="sample.html"-->
<!--#include virtual="/virtual/sample.html"-->

Syntax: fsize file="path"
Context: HTML
The fsize directive inserts the size of the file specified by path, in bytes. For example:

This file is <!--#fsize file=""--> bytes.

Syntax: flasmodfile="path
Context: HTML

Similar to fsize, flastmod inserts the modification date for the file specified by path, For example:

This file was last modified on <!--#flastmod file="example.html"-->

Syntax: config errmsg|sizefmt|timefmt="string"
Context: HTML
You can use the config directive to modify the default SSI behavior. The parameters are as follows: