Share via


Server-Side Include Directives Reference

You can use Server-Side Include (SSI) directives to perform certain tasks in static Web pages. Static Web pages execute slightly faster than Active Server Pages (ASP) pages on a large scale. With SSI directives, you can include the contents of a file in a Web page, include information about a file, include server variables, or include the output from executables, such as Common Gateway Interface (CGI files) and Internet Server API (ISAPI) applications.

With the exception of including executables, all of these tasks can be performed by using ASP scripting. If you need to use ASP script for other tasks in a Web page, you will need to use the ASP solutions for these tasks. With the exception of the #include directive, you cannot mix SSI directives with ASP script.

note Note The server-side time and date functions use the language set by the C-library locale rather than the operating system locale. The C-library locale is usually set to English.

important Important By default, files with the .shtm and .shtml extensions are normally bound to ssinc.dll, the SSI DLL. Mapping .htm and .html files to ssinc.dll will cause a performence degradation, as ssinc.dll must parse the entire file before it is sent. Unless your .htm and .html files actually use SSI directives, it is recommended that these extensions not be mapped to ssinc.dll. Instead, use the .shtm and .shtml extensions for content that requires SSI.

This topic contains the following sections:

  • #config: Specifies the string to be used for SSI error messages and the format to be used for dates and file sizes returned by the #flastmod and #fsize directives.
  • #echo: Inserts the value of a server variable into an HTML page.
  • #exec: Runs an application or a shell command and inserts the output into an HTML page.
  • #flastmod: Inserts the modification date of a file into a Web page, formatted by the #config directive.
  • #fsize: Inserts the size of a file into a Web page, formatted by the #config directive.
  • #include: Includes a file in a Web page. This is the only directive that can be used in ASP pages and STM pages.