../ with SSI ???

admin

Administrator
Staff member
I have a file named links.html in the root folder of my website.<br />
<br />
In root/images/gl/assembly I have a file named index.shtml. In this file, I need to include links.html from the root folder using SSI. So, I first tried simply:<br />
<br />
<!--#include file="/links.html" --><br />
<br />
...to no avail. Browser window shows "[an error occurred while processing this directive]" So, then I remembered about ../ so I tried:<br />
<br />
<!--#include file="../../../links.html" --><br />
<br />
This also did not work...same error.<br />
So, I simply went and put in the entire address of links.html:<br />
<br />
<!--#include file="http://searedice.rchomepage.com/links.html" --><br />
<br />
Still same error and not working!<br />
What in the world am I doing wrong???<br />
Is this just a limit of capability of my host's server?<br />
How can I do this right?<br />
<br />
Thanks,<br />
John<!--content-->i've tried that too, it seems to work in everything but IE<!--content-->I think you need include virtual rather than include file but that's just a WAG.<!--content-->Maybe this (<!-- m --><a class="postlink" href="http://www.smartwebby.com/web_site_design/server_side_includes.asp">http://www.smartwebby.com/web_site_desi ... cludes.asp</a><!-- m -->) will help...<br />
<br />
JayDie<!--content-->Okie dokie. It works with virtual.<br />
<br />
<!--#include virtual="../../../links.html" --><br />
<br />
Thanks for the info...did not know this was the current way to do it. Too bad the reason I'm using SSIs is to reduce the time it takes to edit stuff...now I have to go in to each file and update to "virtual=" from "file="....lol<br />
Good thing I don't have toooo many files on my site yet ;-)<br />
<br />
~John<!--content-->A decent editor like SciTE or Jext will let you do the change on all your pages with one search/replace.<!--content-->I don't like to use editors...I'm an all notepad person ;)<br />
<br />
Also, I do most of the editing on the site's control panel...my host gives me some nice features but I have not found a find/replace one yet.<br />
<br />
I'm all done updating to "virtual=". It only took a couple minutes becuase as I said, I don't have an extreme number of files on my site (yet).<br />
<br />
I'm off to engage in my other hobbies,<br />
John<!--content-->The virtual keyword should only be used when the file in question is located in a dirrerent directory from the script summoning it. Also, the specified path must be virtual (a URL). Otherwise, the file keyword is used.<br />
<br />
Regards,<br />
Andrew Buntine.<!--content-->
 
Back
Top