View Full Version : Problem with SSI #include virtual and absolute path

08-21-2004, 05:21 PM
I am trying to use an SSI to include some common html in my pages. My directory structure is organized as follows:


What I have been doing is creating a shtml file in ssi_test named ssi_test.shtml.

The contents of this file are very simple, and biol down (outside of standard things like head and body tags) to

<!--#include virtual="/public_html/includes/ssi.txt"-->

where ssi.txt is the file I am trying to include. On the server I am using (Apache 1.3 on Linux 2.6) this does not work for some reason. When I look at the error log, the error log says:

unable to include "/public_html/includes/ssi.txt" in parsed file /home/kevin/public_html/ssi_test/ssi_test.shtml

so based onthis information, I try

<!--#include virtual="/home/kevin/public_html/includes/ssi.txt"-->

And get the same error, just with a longer path.

The only way I have gotten it to work is to use the relatative path notation:

<!--#include virtual="../includes/ssi.txt"-->

So my big question is, how do I get SSI includes to work using a ABSOLUTE path? All over the web it claims it shoudl work with an absolute path, but no glory for me so far.

The reason I want an absolute path is that some of my site is multiple levels deep, suchas in dir1/dir2/file.shtml and I would rather avoid using ../../includes where ../ corresponds ot the depth of the site.