niic
02-13-2011, 07:20 PM
Hi all,
Just wondering if someone may shed some light on why SSI would work for my php pages but not my HTML ones?
.htaccess at the site root:
Options +Includes
AddHandler server-parsed .shtml
PHP (works):
<?php include("include/copyright.shtml"); ?>
HTML (fails):
<!--#include virtual="/include/copyright.shtml"-->
The php include finds the file no worries. It sits in a dir called 'include' one level above the root. If I try and target the same location with HTML I get the expected error below:
[an error occurred while processing this directive]
If I stick the copyright.shtml file at the root and pass <!--#include virtual="/copyright.shtml"--> it works fine or even if I send it "../copyright.shtml" it works fine. Why can't HTML locate the file if it sits one level above root??
I don't want to use the FILE command because I don't want the SSI file being evaluated sitting in the same dir as the html it is being served to. You can't use "../" with that anyway so VIRTUAL is your only choice so what am I doing wrong?
Any help would be greatly appreciated. Thanks all!
Cheers,
Nick.
Just wondering if someone may shed some light on why SSI would work for my php pages but not my HTML ones?
.htaccess at the site root:
Options +Includes
AddHandler server-parsed .shtml
PHP (works):
<?php include("include/copyright.shtml"); ?>
HTML (fails):
<!--#include virtual="/include/copyright.shtml"-->
The php include finds the file no worries. It sits in a dir called 'include' one level above the root. If I try and target the same location with HTML I get the expected error below:
[an error occurred while processing this directive]
If I stick the copyright.shtml file at the root and pass <!--#include virtual="/copyright.shtml"--> it works fine or even if I send it "../copyright.shtml" it works fine. Why can't HTML locate the file if it sits one level above root??
I don't want to use the FILE command because I don't want the SSI file being evaluated sitting in the same dir as the html it is being served to. You can't use "../" with that anyway so VIRTUAL is your only choice so what am I doing wrong?
Any help would be greatly appreciated. Thanks all!
Cheers,
Nick.