Server Side Includes

Use Server Side Includes, SSI, (inside HTML comments) on Apache webservers to include dynamic content in your HTML pages.

 

Activate SSI in your web directory by creating a file called ".htaccess" (begins with period, but does not end with .txt or .html). And add this line:

 

AddHandler server-parsed .html .htm .shtml .include

 

SSI Syntax:

<!--#command attribute = "value" -->

 

Example 1 - include header.html file into document:

<!--#include virtual = "header.html" -->

 

Example 2 - include a formatted last modified date into document:

<!--#config timefmt = "%D - %I:%M %p" -->
Page last modified on <!--#echo var = "LAST_MODIFIED" -->

 

example 2 output: Page last modified on 02/05/01 - 03:38 AM

 

More info from Apache: http://httpd.apache.org/docs/howto/ssi.html