SSI won't work... please help!

J

J. Buchmann

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:


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

I have 4 #include lines, thinking one of them would work, but none do.
You can see the actual page here:
http://www.informatik.com/New_Informatik_Site/test2.html.

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?!

Thanks!
John
 
A

Adrienne

Gazing into my crystal ball I observed (e-mail address removed) (J. Buchmann)
writing in
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:


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

I have 4 #include lines, thinking one of them would work, but none do.
You can see the actual page here:
http://www.informatik.com/New_Informatik_Site/test2.html.

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?!

Thanks!
John

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.
 
S

SteW

J. Buchmann said:
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:


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

I have 4 #include lines, thinking one of them would work, but none do.
You can see the actual page here:
http://www.informatik.com/New_Informatik_Site/test2.html.

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?!

Thanks!
John

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
 
J

J. Buchmann

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
ago.

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
extensions.

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

Thanks!
John
 
S

SteW

J. Buchmann said:
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
ago.

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
extensions.

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

Thanks!
John

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

Ste W
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top