Server Side Includes (SSI)
and Server Parsed HTML (SPML)
Apache.org: mod_include handles Server Side Includes (SSI), eXtended Server Side Includes (XSSI)
Server parsed HTML documents are parsed and processed by the server before they are sent to the client.
Quick Notes
-
Apache must be configured to handle SSI (see config notes below)
- HTML documents, files, must end with .shtml (or what ever has been configured)
- See also PHP for alternative server side scripting
Commands
A few examples... (see mod_include for more)
<!--#include virtual="urlpath" --> |
relative and absolute paths are allowed dd |
<!--#include file="filename" --> |
Usage discouraged! "../" or "/..." is not allowed, only files in current and directories beliw ar Ok |
<!--#exec cgi="/cgi-bin/datetime.tcl" --> |
execute a command |
<!--#echo var="DATE_LOCAL" --> |
show current date |
Apache Configuration Notes
Uncomment / add:
AddType text/html .shtml AddHandler server-parsed .shtml
Plus for each Options:
Options ... Includes # or Options ... IncludesNOEXEC # (disables exec and include)
MIME Type Notes
Only documents with MIME types
text/x-server-parsed-html text/x-server-parsed-html3
are processed. Resulting HTML is given MIME type:
text/html
References
- webmaster.iu.edu/tool_guide_info/ssi.shtml , also local copy for eval and research
