Adventures with SSI
File testssi.shtm
Lets see the default errmsg; it may end with a linefeed!
<!--#include file="nofile0" -->
[an error occurred while processing this directive]
<!--#flastmod file="testssi.shtm" -->
<!--#fsize file="testssi.shtm" -->
testssi.shtm Tuesday, 15-Feb-2011 07:20:36 EST
size 10k
←See default timefmt and sizefmt.
<!--#config errmsg="Unable to parse <b>SSI-1</b>" -->
←Change errmsg.
<!--#config timefmt="%Y-%m-%d %H:%M:%S" -->
←Set date format--use dashes.
<!--#set var="pagedate" value="${LAST_MODIFIED}"-->
←Set server variable of testssi.shtm date.
<script type="text/javascript"> var jspagedate =
'<!--#echo var="LAST_MODIFIED"-->';</script>
←Set javascript variable of testssi.shtm date.
<!--#echo var="LAST_MODIFIED" -->
2011-02-15 07:20:36
←See date with dashes.
<!--#include file="nofile1" -->
Unable to parse SSI-1
←Check and compare errmsg.
<!--#include file="testssi.htm" -->
File testssi.htm
<!--#config errmsg="Unable to parse <b>SSI-2</b>" -->
←Change errmsg.
<!--#config timefmt="%Y/%m/%d %H:%M:%S" -->
←Change date format--use slashes.
<!--#echo var="SERVER_SOFTWARE" -->
←Note which server software is running.
<!--#exec cmd="date" -->
←Check if #exec works.
<!--#echo var="LAST_MODIFIED" -->
←See date with slashes. Is it date of include file or requested file?
<!--#include file="nofile" -->
←See new errmsg.
Pagedate javascript:
Pagedate server var:
←If Unable err then #set does not work.
File testssi.shtm
<!--#include file="nofile2" -->
Unable to parse SSI-1
←Did errmsg remain changed "-2" or restored "-1".
<!--#include file="testssi.xls" -->
File testssi.xls
<!--#config errmsg="Unable to parse <b>SSI-X</b>" -->
←Change errmsg.
<!--#config timefmt="%Y:%m:%d %H:%M:%S" -->
←Change date format--use colons.
<!--#echo var="SERVER_SOFTWARE" -->
←Note which server software is running.
<!--#exec cmd="date" -->
←Check if #exec works.
<!--#echo var="LAST_MODIFIED" -->
←See date with colons. Is it date of include file or requested file?
<!--#include file="nofile" -->
←See new errmsg.
Pagedate javascript:
Pagedate server var:
←If Unable err then #set does not work.
File testssi.shtm
<!--#include file="nofile2" -->
Unable to parse SSI-1
←Did errmsg remain changed "-2" or restored "-1".
<!--#include file="testssi2.shtm"-->
File testssi2.shtm
<!--#echo var="novar" -->
(none)
←Check the inherited errmsg.
<!--#config errmsg="Unable to parse <b>SSI-3</b>" -->
←Change errmsg.
<!--#config timefmt="%Y_%m_%d %H:%M:%S" -->
←Change date format--use underscores.
<!--#echo var="SERVER_SOFTWARE" -->
Apache/1.3.31 (HP MPE/iX WebWise A.04.00) mod_ssl/2.8.17 OpenSSL/0.9.7d
←Note which server software is running.
<!--#exec cmd="date" -->
Fri Apr 4 23:07:07 UTC 2025
←Check if #exec works.
<!--#echo var="LAST_MODIFIED" -->
2011_02_15 07:20:36
←See date with underscores. Is it date of include file or requested file?
<!--#include file="nofile" -->
Unable to parse SSI-3
←See new errmsg.
Pagedate javascript:
Pagedate server var: 2011-02-15 07:20:36
←If Unable err then #set does not work.
File testssi.shtm
<!--#include file="nofile3" -->
Unable to parse SSI-1
←Did errmsg remain changed "-3" or restored.
<!--#config sizefmt="bytes" -->
<!--#fsize file="testssi.shtm" --> size of testssi.shtm
10,436
<!--#config sizefmt="abbrev" -->
<!--#fsize file="testssi.shtm" --> size of testssi.shtm
10k
<!--#flastmod file="testssi.htm" -->
testssi.htm 2011-02-15 07:07:36
←Note which date format is being used.
<!--#flastmod file="testssi.shtm" -->
testssi.shtm 2011-02-15 07:20:36
<!--#config timefmt="%Y--%m--%d %H:%M:%S" -->
←Set date format--use double dashes.
<!--#flastmod file="testssi2.shtm" -->
testssi2.shtm> 2011--02--15 07:07:51
<!--#printenv -->
DOCUMENT_ROOT=/APACHE/PUB/htdocs
HTTP_ACCEPT=*/*
HTTP_ACCEPT_ENCODING=gzip, br, zstd, deflate
HTTP_HOST=empire.game-host.org
HTTP_USER_AGENT=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin
REMOTE_ADDR=3.143.213.242
REMOTE_PORT=13656
SCRIPT_FILENAME=/APACHE/PUB/htdocs/openmpe/testssi.shtm
SERVER_ADDR=192.168.1.111
SERVER_ADMIN=info@openmpe.com
SERVER_NAME=empire.game-host.org
SERVER_PORT=80
SERVER_SIGNATURE=<ADDRESS>Apache/1.3.31 Server at empire.game-host.org Port 80</ADDRESS>
SERVER_SOFTWARE=Apache/1.3.31 (HP MPE/iX WebWise A.04.00) mod_ssl/2.8.17 OpenSSL/0.9.7d
UNIQUE_ID=Z-BmF6K--jcAmADYWLo
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
REQUEST_METHOD=GET
QUERY_STRING=
REQUEST_URI=/openmpe/testssi.shtm
SCRIPT_NAME=/openmpe/testssi.shtm
DATE_LOCAL=2025--04--04 18:07:03
DATE_GMT=2025--04--04 23:07:03
LAST_MODIFIED=2011--02--15 07:20:36
DOCUMENT_URI=/openmpe/testssi.shtm
DOCUMENT_PATH_INFO=
USER_NAME=MGR.OPENMPE
DOCUMENT_NAME=testssi.shtm
ssipagedate=2011-02-15 07:20:36
<!--#echo var="AUTH_TYPE" -->
(none)
<!--#echo var="CONTENT_LENGTH" -->
(none)
<!--#echo var="CONTENT_TYPE" -->
(none)
<!--#echo var="DATE_GMT" -->
2025--04--04 23:07:03
<!--#echo var="DATE_LOCAL" -->
2025--04--04 18:07:03
<!--#echo var="DOCUMENT_NAME" -->
testssi.shtm
<!--#echo var="DOCUMENT_PATH_INFO" -->
<!--#echo var="DOCUMENT_ROOT" -->
/APACHE/PUB/htdocs
<!--#echo var="DOCUMENT_URI" -->
/openmpe/testssi.shtm
<!--#echo var="GATEWAY_INTERFACE" -->
CGI/1.1
<!--#echo var="HTTP_CACHE_CONTROL" -->
(none)
<!--#echo var="HTTP_CONNECTION" -->
(none)
<!--#echo var="HTTP_COOKIE" -->
(none)
<!--#echo var="HTTP_HOST" -->
empire.game-host.org
<!--#echo var="HTTP_REFERRER" -->
(none)
<!--#echo var="HTTP_USER_AGENT" -->
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
<!--#echo var="HTTPS" -->
(none)
<!--#echo var="INSTANCE_ID" -->
(none)
<!--#echo var="INSTANCE_META_PATH" -->
(none)
<!--#echo var="LAST_MODIFIED" -->
2011--02--15 07:20:36
<!--#echo var="LOCOL_ADDR" -->
(none)
<!--#echo var="LOGON_USER" -->
(none)
<!--#echo var="PATH" -->
/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin
<!--#echo var="PATH_INFO" -->
(none)
<!--#echo var="PATH_TRANSLATED" -->
(none)
<!--#echo var="QUERY_STRING" -->
<!--#echo var="QUERY_STRING_UNESCAPED" -->
(none)
<!--#echo var="REMOTE_ADDR" -->
3.143.213.242
<!--#echo var="REMOTE_HOST" -->
(none)
<!--#echo var="REMOTE_IDENT" -->
(none)
<!--#echo var="REMOTE_PORT" -->
13656
<!--#echo var="REQUEST_METHOD" -->
GET
<!--#echo var="REMOTE_USER" -->
(none)
<!--#echo var="REQUEST_URI" -->
/openmpe/testssi.shtm
<!--#echo var="SCRIPT_FILENAME" -->
/APACHE/PUB/htdocs/openmpe/testssi.shtm
<!--#echo var="SCRIPT_NAME" -->
/openmpe/testssi.shtm
<!--#echo var="SERVER_ADDR" -->
192.168.1.111
<!--#echo var="SERVER_ADMIN" -->
info@openmpe.com
<!--#echo var="SERVER_NAME" -->
empire.game-host.org
<!--#echo var="SERVER_PORT" -->
80
<!--#echo var="SERVER_PROTOCOL" -->
HTTP/1.1
<!--#echo var="SERVER_SIGNATURE" -->
<ADDRESS>Apache/1.3.31 Server at empire.game-host.org Port 80</ADDRESS>
<!--#echo var="SERVER_SOFTWARE" -->
Apache/1.3.31 (HP MPE/iX WebWise A.04.00) mod_ssl/2.8.17 OpenSSL/0.9.7d
<!--#echo var="TZ" -->
(none)
<!--#echo var="UNIQUE_ID" -->
Z-BmF6K--jcAmADYWLo
<!--#echo var="USER_NAME" -->
MGR.OPENMPE
- Apache - Default errmsg: [an error occurred while processing this directive]
MS IIS - Default errmsg: Error processing SSI file
(linefeed included)
- Apache - Default timefmt: "%A %B %d %Y"
MS IIS - same.
- Apache - Default sizefmt: abbrev
MS IIS - same.
- Apache - supports SSI elements: #printenv #set
MS IIS - DOES NOT support SSI elements: #printenv #set
- Apache - ONLY files with SSI extensions (shtm) are processed for SSI commands.
MS IIS - ALL included files are processed for SSI commands.
- Apache - errmsg is a local setting for each included file.
MS IIS - errmsg is a global setting for all included files.
- Apache - sizefmt=abbrev includes unit letter: k m
MS IIS - sizefmt=abbrev has NO unit letter
- Apache - timefmt is a local setting for each included file.
MS IIS - same.
- Apache - var LAST_MODIFIED in an included file is of the requested page.
MS IIS - var LAST_MODIFIED in an included file is of the included file.
These default and differing functionalities may be server configurable.
With the use of javascript, you may be able to code around the unsupported features.
The above example uses javascript variable jspagedate to get the LAST_MODIFIED
date of the requested page to use in an include file.
SSI also has #if #elif #else #endif for making dynamic decisions in page rendering.
But I have not yet tested them.
2011/02/15 Keven Miller