SSI won't work... please help!

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I can't believe i can't figure this out... a couple years ago i could
do this in my sleep, but now i can't do it!!

I have a very simple html file called test2.html:

<title>Untitled Document</title>
<!--#include file="ssi.txt" -->
<!--#include file="/ssi.txt" -->
<!--#include virtual="ssi.txt" -->
<!--#include virtual="/ssi.txt" -->

I have 4 #include lines, thinking one of them would work, but none do.
 You can see the actual page here: .

The .txt file just has a little bit of text in it.

I tried this exact example on 2 web servers: One Unix based, and one
Microsoft IIS based.  I was able to do SSI years ago on the same Unix
server, so i am really scratching my head.

Can anyone help me here?!


Re: SSI won't work... please help!

Gazing into my crystal ball I observed (J. Buchmann)

Quoted text here. Click to load it

The syntax looks fine. Have you tried naming the file test2.shtml instead
of plain html?  The server probably doesn't know it has to parse the
include directive.

Adrienne Boswell
Please respond to the group so others can share

Re: SSI won't work... please help!

Quoted text here. Click to load it

 I don't know the details for IIS but for Apache you need to have the
.htaccess file set up

Method 1:
Options +Includes
AddType text/html .shtml
AddHandler server-parsed .shtml

Method 2:
Options +Includes
XBitHack on

Method 1: any file in the directories that .htaccess applies to will result
in the web server parsing any file with an extension of .shtml, so you need
to rename to text2.shtml
You can use whatever extension you like but if you use .html then _all_
.html files will be parsed.

Merthod 2: any file with the executable bit is set, that is in the relevant
directories will be parsed.

Then you want <!--#include virtual="ssi.txt" --> in your main file.

Just a note:
.txt should be fine, but in my first experiments with ssi I decided to use
.inc for the include file. This resulted in an error message of 'error
processing this directive' or some such. All was well when I changed the
exrtension to .html

If your include file has further ssi directives it will need to use whatever
method you used for the main file.
Any include files that contain php will need a php extension. etc etc

Ste W

Re: SSI won't work... please help!

Crepe and Adrienne,

Thanks!  It works when i change it from .html to .shtml.

Is this a new thing?  I don't remember having to do this a few years

One more question:  I need to redo a web site that is entirely made
out of .html files.  The boss requires that the extensions stay .html
because he's placed extremely well with all the web search engines,
and doesn't want to change any of the page file names, including the

Is there any way to use SSI while keeping the .html extension, or is
this impossible?


Re: SSI won't work... please help!

Quoted text here. Click to load it

See my post above, esp the parts about method 2 - XBitHack.

Ste W

Re: SSI won't work... please help!

Quoted text here. Click to load it explains all.
Well, not all, but enough for most folks. One day I'll get around to
filling in the rest...

Art Sackett,
Patron Saint of Drunken Fornication

Site Timeline