Knowledge Base

HOME: SSI
Server Side Includes


2. SSI test program

The simplest example of server-parsed HTML is to have a file "foo.shtml" containing this text:

Line one


Line three

And then have a file "mycgi.cgi" that contains, on Unix:

#!/usr/bin/perl

print "Content-type: text/htmlnn";
print "Line Two";


And when you access "foo.shtml", it will output:

Line one
Line two
Line three


If your include directive is , then the cgi program you run must output a standard CGI header (Content-type: text/html)


Any file named foo.shtml will be parsed automatically by Apache on our servers.
Do not put any spaces before the '#' character in your include directives; if you have "