My website is set up to use SSI and it's been working great.
However, when I try to include a file via SSI it won't work for I use a relative path. For example, the following works
<html>
<head>
<!--#include virtual="include/head.shtml" -->
</head>
</html>
But this does not (assume that the files exist)
<html>
<head>
<!--#include virtual="../include/head.shtml" -->
</head>
</html>
Is there something I'm missing, or is there a way I can get more information regarding this error.
According to Apache Tutorial:
The
include
element can determine what file to include with either thefile
attribute, or thevirtual
attribute. Thefile
attribute is a file path, relative to the current directory. That means that it cannot be an absolute file path (starting with /), nor can it contain ../ as part of that path. Thevirtual
attribute is probably more useful, and should specify a URL relative to the document being served. It can start with a /, but must be on the same server as the file being served.
According to Wikipedia:
"
virtual
" specifies the target relative to the domain root, while "file
" specifies the path relative to the directory of the current file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With