The Following is a Tutorial on Server Side Includes Setup
Purpose: The purpose of this tutorial is to provide you with the exact settings needed to setup SSI in your web pages via the Internetter.com Interactive Virtual Servers.
Disclaimer: These settings are fairly standard for most web servers. If your service provider allows SSI these settings just might work fine the first time... Otherwise, more detailed instructions can be found at NCSA.
Why: Generally, you will want to do two things using Server Side Includes:
1. Insert a standard block of text into your web page automatically, so that if you wish to change a footer of all of your pages, you simply have to change one file.
2. Insert a CGI into your web page, so that if you wish to generate a random line of your favorite poetry from a poetry CGI on your home page, etc...
3. And, also because, and I'll go out on the limb on this one, SSI is probably the easiest to utilize and most powerful feature of your web server-- if you use it.
How:1. Here is how to insert a standard block of text into your web page:
Include the following code in your web page:
<!--#include virtual="yourpage.html"-->
This will insert HTML into your web page. The yourpage.html does not require header tags. It is simply a batch of text/HTML.
2. Here is how to insert a CGI into your web page:
Include the following code in your web page:
<!--#exec cgi="/cgi-bin/webxxxxx/program1.cgi"-->
3. You will have to save the page as yourfile.shtml.
Samples:
Redirect CGI
Example of a server side include inserting a block of text/HTML. The code actually reads like this (the result shown below):
<!--#include virtual="redirect.html"-->Example of a server side include calling a CGI. The code actually reads like this (the result shown below):
<!--#exec cgi="/cgi-bin/calendar.cgi"-->
The Calendar program will fill in below this line:
[an error occurred while processing this directive]
The Calendar will end above this line:
Counters
SSI's are particularly good for counters. You are the [an error occurred while processing this directive] to visit this page (reload to see the number change).
If you view the source of this page you will not be able to see the SSI code. That's the power of SSI's.
That's it.
Additional Resource:
SSI: The WebMaster's Secret Weapon
SSI's installed on this site: Test Page
New Breed Software's SSI Page Exceptional all in one tutorial!
(some minor modifications will be needed when you call a particular SSI)