Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSI include virtual relative path not working

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.

like image 759
David Milanese Avatar asked Mar 15 '23 06:03

David Milanese


1 Answers

According to Apache Tutorial:

The include element can determine what file to include with either the file attribute, or the virtual attribute. The file 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. The virtual 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.

like image 198
Valentin Podkamennyi Avatar answered Apr 02 '23 19:04

Valentin Podkamennyi