Click to See Complete Forum and Search --> : SSI Directives


MrNewbie
06-11-2001, 06:37 PM
Why can I not use a full path on an SSI directive? I have <!--#include virtual="include" --> which works fine but I can't have <!--#include virtual="/home/user/public_html/include" --> or it gives an error. I guess this is so no one can <!--#include virtual="/etc/passwd" --> but I have gotten round this by using ../'s to back up directories before so it would probably work to be able to include the passwd or any other files.
Anyway, is there a way I can use full paths? I've been looking at SSI and can't see anything that may help but maybe there is?

freebsd
06-12-2001, 01:05 AM
>> but I can't have <!--#include virtual="/home/user/public_html/include" -->

Because you can't use include above your docroot. In this case, /home/usr/public_html is the docroot.

Say you wanted to include this file -> /home/user/public_html/include/header.txt, you can use either one as follow:

1) <!--#include file="include/header.txt"-->
2) <!--#include virtual="/include/header.txt"-->

file must be a relative path to your current html document while virtual is the absolute path below your docroot.

MrNewbie
06-13-2001, 10:03 AM
Oh so its relative to the docroot. Thanks, I wish I'd known that earlier.

MrNewbie
06-13-2001, 10:04 AM
Oh so its relative to the docroot. Thanks, I wish I'd known that earlier.