Using SSI's To Ease Site Maintenance
By Lauri Harpf2003-09-27
SSI's To The Rescue
If your host supports Server Side Includes and is running Apache, you can use this article to make your table design as easy to maintain as it would be if you were using frames. The best part is that visitors won't even notice that you have changed anything. After the new system is in place, they will see exactly the same design and HTML code as before, but you will be saved from hours of monotonous work.
Server Side Includes, or SSI's, can be used in many ways. With them you can execute CGI programs, display the current date & time on your page and do plenty of other things as well. In this article, we use them for including external files to your HTML. The idea is to create a separate file from your navigation menu and use SSI's to point to it, requiring you to merely edit one file when you wish to change the navigation.
Should you have some knowledge of Server Side Includes, you might be a little worried. Doesn't this require that you rename all your pages from ".html" to ".shtml" if you want it to work? That would take a lot of time, break the links that are pointing to your site and you might have to resubmit your pages to the search engines. Is it reasonable to go through all that trouble to make maintaining your site a little easier?
Fortunately, there's no need to start renaming any files. You can simply instruct the server to treat your ".html" files as ".shtml" files and execute all SSI instructions in them. This can be done with a ".htaccess" file. If you already have one, you'll have to edit it. If you don't, open up a text editor, such as Notepad, and paste the following lines into a blank file. Be sure to replace .html with .htm, if you're using that extension.
Options Includes
AddType text/html .html
AddHandler server-parsed .html
Save the file in "All files" mode and name it ".htaccess". Include the quotes so that Notepad won't decide to name the file ".htaccess.txt".
Tutorial Pages:
» Using SSI
» SSI's To The Rescue
» Changing Your Pages
