How to Use SSI

Written by Silverwing.

0 Comments

In this guide, you will learn how to update all of your pages quicker using SSI.

What is SSI and what are its uses?

Server Side Includes (SSI) allows you to update all of your pages faster, and is a great and simpler alternative to PHP. SSI is basically a simple include that you can put on your pages, enabling you to update all of them by changing one file, instead of going back to all of the pages and updating each one individually. Small sites don't have a problem with that. But, as your site grows and you add more pages, you'll find out how annoying it is to edit all of your pages just to add, say, another link to your navigation bar. Well, now that you've learned how great it is, you're obviously itching to learn it. And I'll show you how. :)

How to Use SSI

First of all, before you do ANYTHING (coding and whatnot), change all of your page extensions to .shtml. This is a very common mistake in those learning SSI. They just slap on the code onto all of their pages and consider it a job done. NO! You must change all of your file extensions to .shtml or it WILL NOT WORK. So if there was a page called home.html, change it to home.shtml. Got it? Now, onto the coding.

After you've finished converting the page extensions, cut the part of the page that you know you will update frequently (for example, a navigation bar or affiliates bar) and paste it onto a Notepad document for safe keeping. Then, in place of the cut area, put this:

<!--#include file="textfilename.txt" -->

Replace the textfilename to the name of your Notepad document. Upload the Notepad document onto your server, and you're all set. So, if I had a page that looked like this:


And I wanted to get rid of the navigation for easy editting, it will now look like this:


Do that to all of your pages. So, if you want to update the Navigation bar with something new, simply edit the navigation.txt file instead of all of the pages. Simple huh?
eXTReMe Tracker
All layouts, content, and custom images are © 2006-2009 of Lugia's Island and its contributors. Layout made by Silverwing. None may be reproduced without explicit permission. Pokémon is copyright © 1994-2009 of Nintendo GAME FREAK.
Custom brushes on the images downloaded from Brusheezy.