blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Mark Wilson's Blog

Using server side includes in web pages

One of the features used in my main and family websites is server side includes (SSI). The SSI code allows my sites to include dynamic information which would otherwise require scripting that may not function correctly with certain browsers.

SSI is pretty simple. Apache users need to edit the .htaccess file in their web root directory to allow SSI, adding the following lines:

    Options Includes AddType text/html .shtml AddHandler server-parsed .shtml

Some of these may not be necessary if they have been set at a higher level in the Apache configuration by the ISP or server administrator - for full details, see the Apache Tutorial: Introduction to Server Side Includes.

Microsoft Internet Information Server (IIS) users can find information on using server side include directives in the IIS 6.0 Operations Guide.

Once enabled, pages which call the server-based code should be named .shtml (or whatever file extension is defined in the configuration). Because my ISP has configured its servers for the default web page to be called index.htm or index.html, it was also necessary to change the default documents for the website.

One use of SSI to reuse common HTML code (e.g. headers, menus, etc.), but another useful application is to report document information (e.g. date last modified). There are many references on the Internet for SSI options, but one of the most useful is Craig McFetridge's SSI page on the Carleton University website, with another being the one found on the ThinkQuest Amazing HTML website.

Published 08 December 2004 17:03 by mark.wilson
Filed under: , ,

Comments

 

Mark Wilson's Blog said:

My ISPs' Apache servers are configured for index.html and index.htm to be the default documents; however...
August 6, 2005 19:03
 

Mark Wilson's Blog said:

A few weeks back, I updated my main and family websites (which run on my ISPs' Apache servers) to use...
August 6, 2005 19:05
Anonymous comments are disabled

This Blog

Syndication

News

    Mark Wilson used to be a Senior Technical Consultant at Conchango, where his blog entries were based on personal opinions and experiences, were not read or approved before being published, and were provided in good faith.
    The names of actual companies and or products mentioned may be the trademarks of their respective owners.
Powered by Community Server (Personal Edition), by Telligent Systems