Basic SSI directives Syntax
1 |
<!--#element attribute=value attribute=value ... --> |
Today’s date
1 |
<!--#config timefmt="%Y/%m/%d %a %H:%M:%S" -->Today is <!--#echo var="DATE_LOCAL" --> |
Modification date of the file
1 |
This document last modified <!--#flastmod file="index.html" --> |
Including the results of a CGI program
1 |
<!--#include virtual="/cgi-bin/counter.pl" --><!--#include virtual="/cgi-bin/example.cgi?argument=value" --> |
You can use "#exec cgi=" directive, but it can be disabled using the IncludesNOEXEC Option.
Including a standard footer
1 |
<!--#include virtual="/footer.html" --> |
Executing commands
1 |
<!--#exec cmd="ls" --> |
This feature is dangerous. You can allow SSI, but not the exec feature, with the IncludesNOEXEC argument to the Options directive.
Setting variables
1 |
<!--#set var="modified" value="$LAST_MODIFIED" --><!--#set var="date" value="${DATE_LOCAL}_${DATE_GMT}" --> |
Conditional expressions
1 |
<!--#if expr="test_condition" --><!--#elif expr="test_condition" --><!--#else --><!--#endif --> |