Hey Everyone.
I'm trying to figure out SSIs.
Here's the one I include in every HTML file (shtml file, of course)...
<!--#include file="topSection.html"-->
Unfortunately, I have to have every single HTML page in the same folder as the topSection.html file in order for my includes to work.
So as you can imagine, very unorganized.
When I try to organize the HTML files into folders, the include no longer works.
Obviously it's because the <!--#include file="topSection.html"--> command is pointing to a file that's supposed to be in the same directory.
So naturally, I tried doing an absolute location like http://mywebaddress/folderBlah/topSection.html
But that doesn't work. I tried using that absolute path, and changing my include command to a virtual type like this <!--#include virtual="absoluteaddress/topSection.html"--> But that didn't work either.
Then I tried virtual with a relative path, nothing.
Unless the file is in the same folder, it says "an error occurred while processing this directive" where the Include would have gone, and displays the rest of the page fine.
I even tried the PHP include. Nothing appears at all, not even an error.
How do I tell it to look "one level up"? Is it <!--#include file="../topSection.html"--> like that? Does it have to be virtual for that to work? I tried ../topSection.html with both file and virtual but it still gives the error.
Is there some setting in the server that I have to change?? It's an Apache server.
Any tips are useful =)
Thanks!
I'm trying to figure out SSIs.
Here's the one I include in every HTML file (shtml file, of course)...
<!--#include file="topSection.html"-->
Unfortunately, I have to have every single HTML page in the same folder as the topSection.html file in order for my includes to work.
So as you can imagine, very unorganized.
When I try to organize the HTML files into folders, the include no longer works.
Obviously it's because the <!--#include file="topSection.html"--> command is pointing to a file that's supposed to be in the same directory.
So naturally, I tried doing an absolute location like http://mywebaddress/folderBlah/topSection.html
But that doesn't work. I tried using that absolute path, and changing my include command to a virtual type like this <!--#include virtual="absoluteaddress/topSection.html"--> But that didn't work either.
Then I tried virtual with a relative path, nothing.
Unless the file is in the same folder, it says "an error occurred while processing this directive" where the Include would have gone, and displays the rest of the page fine.
I even tried the PHP include. Nothing appears at all, not even an error.
How do I tell it to look "one level up"? Is it <!--#include file="../topSection.html"--> like that? Does it have to be virtual for that to work? I tried ../topSection.html with both file and virtual but it still gives the error.
Is there some setting in the server that I have to change?? It's an Apache server.
Any tips are useful =)
Thanks!