1. Home
  2. Computing & Technology
  3. Web Design / HTML

How To Include HTML in Many Documents Using SSI

By , About.com Guide

If you want the same content copied over multiple pages of your site, with HTML you'll need to manually copy and paste that content. But if you have SSI on your server you can write one file and then include it on your Web pages where you need it.

SSI requires that you have it installed on your Web server. Contact your system administrator if you're not sure.

Difficulty: Average
Time Required: 15 minutes
Here's How:
  1. Write the HTML you want repeated and save it to a separate file.
    I like to save my include files into a separate directory, usually "includes". I would save my copyright information in an include file like this:
    includes/copyright.ssi
  2. Open the Web page where you want the include file to display.
  3. Find the location in the HTML where the include file should display, and place the following code there:
    [an error occurred while processing this directive]
  4. Change the path and file name to reflect your include file location.
  5. Add that same code to every page you want your copyright information on.
  6. When the copyright information changes, edit the copyright.ssi file. Once you've uploaded it, it will change on every page of your site.
Tips:
  1. You can include HTML or text in an SSI include file. Anything that can go in an standard HTML file can go in an SSI include file.
  2. You can put SSI includes anywhere in your HTML document, including the head.
  3. Your readers will not know you're using SSI unless you name all your files ssi or shtml. The pages will display as plain HTML.
What You Need:
  • SSI on the server
Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. Web Server Management
  5. SSI
  6. How to Include HTML in Many Documents Using SSI>

©2009 About.com, a part of The New York Times Company.

All rights reserved.