Server Side Includes Tutorial (SSI) » Onpoint Creations Web Blog

About Onpoint Creations - Sydney Website Design
Home Who We Are Our Services Our Client List Our Portfolio Our Webblog Contact Us Sitemap

Sydney Search Engine Optimisation

About Onpoint Creations Sydney Website Design   About Onpoint Creations Sydney Website Design

Server Side Includes Tutorial (SSI)

If you have never heard of or used a Server Side Include (SSI) before, then you must read this post, as a Server Side Include is one cool way to insert content into your web page. When you use a Server Side Include the server takes the entire content of one file and places it onto your page, where you specify it. A Server Side Include would be used for such things as a navigation menu on a site, where the navigation menu is re-used on many or every single page. By using a Server Side Include, when you go to update the menu, you only have to update one file instead of every page that has the menu, makes sense huh?

I would recommend to use a Server Side Include where ever content is re-used across many pages. On many websites this includes the header, footer and navigation menu. A Server Side Include saves you serious time when you need to make a site wide change. You simply edit the include file, upload it the the change is automatically made site wide.

How to do it:

  1. Select & copy the code from your web page that you wish to re-use across your site.
  2. Create a file & past the code from step 1 into it. Name this file with the extension .htm, .html, .asp, .aspx or .php.
  3. Select the file from step one, and insert this code into the area where the old code used to be (choose one depending on technology used):
  4. PHP: <?php include(“./relative-path-to-document”) ?>
    ASP or SHTML: <!–#include file=”./relative-path-to-document” –>
  5. Ensure that any pages with the code from step 3 ends in either .shtml, .asp, .aspx or .php. If you name the file ending in .html the SSI will not work.

You can click here to download a working example.

One Response to “Server Side Includes Tutorial (SSI)”

  1. Totally Free Racing Games Says:

    I really like your website and i really appreciate the great quality content you are posting here for free for your online readers. Thanks.

Leave a Reply

About Onpoint Creations Sydney Website Design   About Onpoint Creations Sydney Website Design