SSI Include

D

Dennis Marks

In all of the years I've been making web pages I never tried to do a
server side include. Today I tried it and I can't get it to work.

I have the following 2 pages.
http://www.dcs-chico.com/~denmarks/test.html
and
http://www.dcs-chico.com/~denmarks/test2.html

Both exist, I've checked.
The first file has the following include
<!--#include file="test2.html" -->
The second file has one line of text.

When I run the first file it does not display the included text. When I
look at the source I see the message "include error - file not found".
What am I doing wrong?
 
T

Tina - AffordableHOST.com

Try changing the file name to test.shtml - ssi generally requires that you
name your pages with the .shtml extension by default. Also, make sure the
server you're on actually supports SSI.

--Tina
 
B

brucie

in post: <
Dennis Marks said:
In all of the years I've been making web pages I never tried to do a
server side include. Today I tried it and I can't get it to work.

I have the following 2 pages.
http://www.dcs-chico.com/~denmarks/test.html
http://www.dcs-chico.com/~denmarks/test2.html

Both exist, I've checked.
The first file has the following include
<!--#include file="test2.html" -->
The second file has one line of text.

the tech tips for the webstar server say the default file extension is
now .shtml instead of .ssi

and there is a comprehensive demo here:
/Applications/4DWebSTAR/WebServer/DefaultSite/Examples/SSI/ssi_demo.shtml
(http://127.0.0.1//Examples/SSI/ssi_demo.shtml)

http://www.4d.com/knowledgebase?CaseID=32308

if you want to use the .html extension you need to do this:
http://www.4d.com/knowledgebase?CaseID=20792

i'm not going to download the manual to find out more:
http://ftp.4d.com/ACI_PRODUCT_REFER...D_Product_A-Z/4D_WebSTAR/WebSTAR_4_Manual.pdf
 
D

Dennis Marks

brucie said:
in post: <

the tech tips for the webstar server say the default file extension is
now .shtml instead of .ssi

and there is a comprehensive demo here:
/Applications/4DWebSTAR/WebServer/DefaultSite/Examples/SSI/ssi_demo.shtml
(http://127.0.0.1//Examples/SSI/ssi_demo.shtml)

http://www.4d.com/knowledgebase?CaseID=32308

if you want to use the .html extension you need to do this:
http://www.4d.com/knowledgebase?CaseID=20792

i'm not going to download the manual to find out more:
http://ftp.4d.com/ACI_PRODUCT_REFER...D_Product_A-Z/4D_WebSTAR/WebSTAR_4_Manual.pdf

I was required to use
<!--#include virtual="/~denmarks/test2.data" -->
instead of
<!--#include file="test2.data" -->

The included file was in the same directory but for some reason only
the first version works. I did not need SHTML. HTML worked.
 
W

Weyoun the Dancing Borg

Dennis said:
In all of the years I've been making web pages I never tried to do a
server side include. Today I tried it and I can't get it to work.

I have the following 2 pages.
http://www.dcs-chico.com/~denmarks/test.html
and
http://www.dcs-chico.com/~denmarks/test2.html

Both exist, I've checked.
The first file has the following include
<!--#include file="test2.html" -->
The second file has one line of text.

When I run the first file it does not display the included text. When I
look at the source I see the message "include error - file not found".
What am I doing wrong?


you cant do a SSI on a .HTML page. It has to be ASP or PHP or similar.
 
S

Steve Pugh

Weyoun the Dancing Borg said:
you cant do a SSI on a .HTML page. It has to be ASP or PHP or similar.

Yes you can. If your server is configured to parse .html files for SSI
directives then you can do one. And even if your server needs the
files to be called .shtml that's still an order of magnitude different
to using something like ASP or PHP.

Steve
 
D

Dennis Marks

Steve Pugh said:
Yes you can. If your server is configured to parse .html files for SSI
directives then you can do one. And even if your server needs the
files to be called .shtml that's still an order of magnitude different
to using something like ASP or PHP.

Steve
On my server it does work with .html. I also need to use "include
virtual" rather than "include file".
 
D

Dennis Marks

no spam said:
Wrong. Just rename the pages from html to shtml

x-no-archive:yes

You are misquoting since I didn't write that.

BTW: It depends on your server. Some, such as mine, scan all html. The
s is not needed.
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top