Server Side Includes

Introduction:

Server Side Includes(SSI) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. They let you add dynamically generated content to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology. [apache.org]

How:

Firstly, your server must be configured to permit SSI. Secondly, the extension you use is .shtml, and make sure your includes are .shtml as well. That way you can use conditional expressions in them.

Examples:

Today’s Date: <!–#echo var=”DATE_LOCAL” –>
File Last Modified: <!–#flastmod file=”index.html” –>

Including an external file called footer.shtml in an includes folder: <!–#include virtual=”includes/footer.shtml” –>

Conclusion:

SSI is no replacement for PHP or other scripting languages, but can certainly help add a bit of flexibility to a website. SSI is especially helpful in the top, left and footer areas of static websites.

Apache Tutorial: http://httpd.apache.org/docs/1.3/howto/ssi.html