PDA

View Full Version : SSI Includes - silly(?) Problem


pigman
01-26-2009, 05:45 PM
Thanks to advice from edbr I am now re-designing a site using SSI includes.

I now have what I think is probably a silly problem!

I have created a file 'layout.shtml' which is in the 'includes' directory.

I have created a template which uses the layout.shtml file, which is in the 'templates' directory.

I have created about 18 files, including an index, all named xxxxx.shtml and they all work perfectly but for one.

One file calls files that are in their own directory, they don't work when I call them from the menu, I get this error message:

[an error occurred while processing this directive]

I suspect the problem is in the path to the 'include' file but I'm not sure and whatever I try makes no difference.

Ideas or suggestions anyone please.

TIA

Tim
site is here http://www.lacef.fr

pigman
01-31-2009, 03:29 PM
As per the previous post I have been having problems using SSI files called by files which are not in the root directory.

It seems that this is a very common problem - I have found dozens of posts all looking for a fix.

The problem is definitely connected to the path to the /includes directory, I have tried turning 'virtual path' on and off and putting the root directory of the site in the path, a modded .htaccess file, all to no avail.

After a week of head scratching and lots of experiments I have found a way to make it work - sort of!

And in fact the answer is fairly simple - create an 'includes' directory in all the site subdirectories that use the ssi script you want to use on the pages in that directory.

Elegant it isn't but it does work. There is a potential problem - if you modify the original file, you MUST remember to copy it to all the other includes files. But actually that may be an advantage! Doing it this way means that you could use a layout file whic is different for each subset of files.

Anyway - hope it helps someone else.

Tim