LA InterWeb - Powering Web Sites Worldwide
Home About Us Products & Services Resellers Support Contact Us Order Now!
Support Center / Knowledge Base
Home > Support Center > Knowledge Base > SSI (Server Side Includes)

SSI (Server Side Includes)

In This Section:

   » Does LA InterWeb support SSI(server side includes)?



Does LA InterWeb support SSI(server side includes)? Top

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

Line one
<!--#exec cgi="mycgi.cgi" -->
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 <!--#exec cgi="..." -->, 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"

<!-- #exec" instead of "<!--#exec", the line will be ignored.>

Server-side includes in "custom trailers" will not work, since custom trailers are appended to the output of your web pages after all other processing has been done on them. Any server-side includes that you put into your custom trailers will be sent directly to the browser without being parsed.


By default, we don't set up our servers to recognize server-side includes (SSIs)in regular .html pages because there is a loss in performance when every single .html page is parsed.

More Help for using SSI can be found at: http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html

SSI That is Not Allowed

EXEC CMD

.shtml page shows up as code

If this happens, SSIs haven't been enabled for the domain. You need to contact LA InterWeb at support@apollohosting.com and we will enable it for you.

Parsing .html as well as .shtml

By default, we don't set up our servers to recognize server-side includes (SSIs) in regular .html pages because there is a loss in performance when every single .html page is parsed.

IF YOU ARE NOT USING Microsoft. FrontPage., you can set this up as a Mime Type in an .htaccess file.

Open the .htaccess file in the domain-www directory and add this line, or create a file named .htaccess and insert just this line:

AddType text/x-server-parsed-html .html

If they are using Microsoft. FrontPage., you are out of luck. Using an .htaccess file will mess up Microsoft. FrontPage..

SSI test program

Simple SSI program to test if SSIs are set up to work on your domain:

#<HTML>
#<Head><Title>I was modified</Title></Head>
#<Body>
#<H1>I was modified</H1>
#<P>I was last modified on
#<!--#echo var="LAST_MODIFIED" -->
#</P>
#</Body>
#</HMTL>

Save this as something like test.shtml in yourdomain.com-www and call it from a browser. If LAST_MODIFIED is replaced by the file creation date and time, SSIs work.

Source: "Server Side Includes" by Reuven M. Lerner (Linux Journal, June 1998).

Example

The "include" command has two property types available. FILE and VIRTUAL. Both of these do the exact same function. FILE is used when the included file is located in the same directory (or subdirectory) as the web page calling it. VIRTUAL is used when the included file is located in a directory address starting at the server root (not in the same directory as the web page calling it).

FILE : <!--#include file="page1.shtml" -->

VIRTUAL: <!--#include virtual="/subdirectory/page2.shtml" -->

The first forward slash in the VIRTUAL example above tells the server to start at the root directory. It then goes up the named
subdirectory and finds the specified file to include.

page1.shtml


<html>
<head>
<title>Test Page</title>
</head>
<body>
<!--#include file="page2.shtml" -->
</body>
</html>


<table border="5">
<tr>
<td>
Hello. This is a test.</tr>
</td>
</table>



IMPORTANT ANNOUNCEMENT

LA InterWeb Hosting is now called Sedna Hosting, a division of Sedna Solutions

Visit the Sedna Hosting web site for more information about our hosting services.

Overview
Getting Started
Knowledge Base
Frequently Asked Questions
Current Network Status
Online Manuals
24/7 Help Desk


30 Day Money Back Guarantee!

Try It Now! Give our control panel a test drive!

Save Money! FREE Setup & 6 FREE Months of Hosting with every new web hosting account! Click for details.

Back to TopSite MapE-Mail This Page To A Friend
Search for a Domain Name
. Order Now! Start working in just 10 minutes!
Copyright © 2003 LA InterWeb. LA InterWeb, the LA InterWeb logo, and related marks are property of LA InterWeb. All other marks are the property of their respective owners. All rights reserved. Acceptable Use Policy. Privacy Statement.