Basic SSI Directives

All SSI directives have the format:

<!--#command parameter(s)="argument"--> 

Each of the symbols is important; be careful not to forget the pound sign (#).

Following is a list of the primary Server Side Includes, the parameters they take, and what they do.

echo

Inserts value of special SSI variables, as well as other environment variables. For example:

<H1>Welcome to my server at <!--#echo var="SERVER_NAME"-->...</H1> 

See also CGI Environment Variables, and "SSI Environment Variables" later in the current chapter.

include

Inserts text of document into current file.

Arguments

For

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

fsize

Inserts the size of a specified file.

The size of the file is <!--#fsize file="/mytutorial.ps"--> bytes. 

flastmod

Inserts the last modification date and time for a specified file.

The file was last modified on <!--#flastmod file="/mytutorial.ps"-->bytes. 

You can specify the format of the date and time returned using the config directive with the timefmt argument; timefmt takes a wide range of values described in the section "Configurable Time Formats For SSI Output" later in this chapter.

exec

Executes external programs and inserts output in the current document.

Arguments

For example:

<!--#exec cmd="/bin/finger $REMOTE_USER@$REMOTE_HOST"--> This page has been accessed <!--#exec cgi="/cgi-bin/counter.pl"--> times. 

config

Modifies various aspects of SSI.

Arguments