Click to See Complete Forum and Search --> : SSI Includes - referencing a file in a parent directory


gardanni
11-19-2004, 07:46 AM
I am having problems using SSI includes to reference files that reside in the parent directory of a folder. SSI works when including files that reside in the current folder or deeper. Results of my tests are shown below.

I wonder if this is simply a matter of syntax - does the "../" convention not work in the SSI scripting language, and if not, can someone help me work around this?

My project entails the automatic generation of about 50 folders full of information. Each folder contains subfolders, and there is data in each main folder that needsd to be referenced from files in subfolders. I don't think a virtual path would work because I'd have to add virtual paths for each folder! I can edit the templates that create these folders (and thereby add the SSI codes), but I cannot alter the directory structure or location of files.

Any helpful comments would be greatly appreciated.

Dan

-------------------------------------------------

RESULTS OF MY TESTS

include filename: This is the contents of filename

test3/filename: This is the contents of filename

./artistname: This is the contents of filename

../filename: [an error occurred while processing this directive]

test3/../filename: [an error occurred while processing this directive]

TheBearMay
11-19-2004, 07:57 AM
Are you using file= or virtual= ?

gardanni
11-19-2004, 10:20 AM
thanks for the reply. i was using FILE, and resolved the problem by using VIRTUAL instead.

i misunderstood what VIRTUAL was all about... i thought that would establish a virtual path that would be relative to the root of the site, and i needed to INCLUDE files from folders in the same subdirectory tree as the file that was calling them. in truth, i am still not clear on the difference between FILE and VIRTUAL -- except that VIRTUAL works!

cheers.

dan