Boost your sales with Web Marketing Today Premium Edition

Server Side Includes (SSIs)
and Navigation Systems

by Dr. Ralph F. Wilson
Web Marketing Today, Issue 47, August 1, 1998

There larger your site is, the more you need to consider constructing it with Server Side Includes (SSIs for short). SSIs allow you to modify your navigation system quickly and easily. If your site is a dozen pages or so, don't bother with SSIs. But when you get to 20 pages or more, they're well worth the learning pain they generate. SSIs are text files on your server that are called whenever a visitor clicks on your URL. Here's how they work.

Most business pages have a lot of material that is the same on every page: left-side menu, top graphic, bottom text, etc. With SSIs you can make each of these sections into a Server Side Include file to insert like "boilerplate" text into your Web page. The code to left-side menu into your page would be something like:

<!--#include virtual="/ssi/wmt-side.ssi"-->
This command inserts about 50 lines of HTML. I use SSIs to call the left-side menu, top graphic, a line under a page title, a banner ad, and the text and image map, copyright information, etc. at the bottom of the page. To change the left-side menu, I don't have to touch the Web pages, only the file I've named wmta-side.ssi.

Tips

Here are a few technical tips about SSIs:

You don't need to use the traditional *.shtm and *.shtml filename extensions. You can ask your ISP to turn on SSIs for your entire site. Or you may be able to do it yourself without his permission by inserting a file named .htaccess in your root directory containing such lines as:

Options Includes FollowSymLinks
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-html .htm
AddType text/x-server-parsed-cgi .cgi

If you use FrontPage, you might try the "Include Page Component" which does the same thing as SSIs.

Learning Resources

SSIs are thing a beauty, but not for beginners. Do not try this at home. (Okay, go ahead and try it, but when you start pulling your hair out in tufts, don't say I didn't warn you.) The documentation available on Server Side Includes is poor. Yes, all the elements are there, but they seem pretty cryptic when you don't know what they mean. You'll just have to do some trial and error to learn this, though you'll find some help with these resources:

SSIs are very necessary for large sites, even though SSIs are a pain to learn and implement, and are an increased burden on the server. They are very well worth the pain the next time it comes to redesign your site's navigation system.

Please note: I am unable to field questions about implementing SSIs. I'm sorry. However, I'll offer a few tips:

  • Begin by testing a file that contains just one or two of these commands before you set up an entire system.
  • If your Web page comes up with the message "[an error occurred while processing this directive]" that indicates that the server is scanning your page for SSI commands, but something is wrong with the command within your Web page. If you see this error message, your .htaccess files is probably working okay.
  • Look for picky little things such as a beginning forward slash in front of the virtual command /ssi/filename.txt. Also, some servers or some CGI programs running on SSI pages may require you to remove any spaces between the actual command and the <!-- --> outer "envelope."
  • Make sure you reload/refresh the Web page with your browser after making these tiny changes. Otherwise, you may have fixed it and not know it.
  • Troubleshooting SSIs is frustrating at best. Remember, we can't field questions about this seemingly mystical procedure. I wish you the best! For further help consult Mark West's Server Side Includes Tutorial.

 

AddThis Social Bookmark Button

Three free e-books Subscribe to our free e-mail newsletter — Web Marketing Today®, published to 104,000+ confirmed opt-in subscribers worldwide. Just to encourage you to take this step, I'm including three free e-books that you can download and read: The Web Marketing Checklist: 32 Ways to Promote Your Website, 12 Website Design Decisions Your Business Will Need to Make, and Making & Marketing E-Books, each worth $12 -- just for subscribing. No catch.



(2-letter abbreviation)




Sample newsletter. We respect your privacy and never sell or rent our subscriber lists. Subscribing will not result in more spam! I guarantee it!

RSS Feed Subscribe to the Web Marketing Today RSS Feed



(2-letter abbreviation)


Sample newsletter. We respect your privacy and never sell or rent our subscriber lists. RSS Feed: RSS Feed