-
ssi and sub folders
Hi-
I'm using the method described here
http://www.andreas.com/faq-ssi.html
to change the ssi's I originally did as php / .inc. Worked beautifully for the pages in the root folder, using
<!--#include file="ssi-mainheader1.html" -->
to call the include, and an .htaccess file that says "AddType text/x-server-parsed-html .html" to get around the .shtml thing. Just like it said in the article.
But, when I go to change pages in subfolders, I can't get the include right. I thought it would be <!--#include file="../ssi-mainheader1.html" -->, but I get a processing error on the page. I tried using the same include as on the root pages, I tried <!--#include file='../ssi-mainheader1.html' -->, I tried the absolute path of <!--#include file="www.mainsite.com/ssi-mainheader1.html" -->, still got nowhere. I even tried moving the .htaccess file into the subfolder.
I finally loaded the include files into each subfolder, but that kind of defeats the purpose of using an include. Help! I'm sure the correct command exists, but I can't find it. As you can tell, I am pretty much a noob, learning as I go. Thanks for any help.
-
Haven't used SSI in along time but try using a full path instead of a relative one:
<!--#include file="/ssi-mainheader1.html" -->
-
Thanks, but that didn't work either. It makes no sense!
-
Make sure you have the path right. Try using the full path on the server, too.
-
not clear
It's not clear to me what you mean? I tried using
<!--#include file="www.domainname.com/ssi-mainheader1.html" -->
Is that the full path? What is meant by the full path for the server?
I really appreciate the time! I have a new menu to post, but don't want to do it until I get this include figured out.
-
Solved it!
Found this http://www.tdscripts.com/ssi.html in a thread, which said if you are not in the root folder, you need to use <!--#include virtual="/ssi-mainheader1.html" -->, virtual for file. Works great now.