SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Haven't used SSI in along time but try using a full path instead of a relative one:

    <!--#include file="/ssi-mainheader1.html" -->

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, but that didn't work either. It makes no sense!

  4. #4
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Make sure you have the path right. Try using the full path on the server, too.

  5. #5
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  6. #6
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •