The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Calling SSI from other directories

Discussion in 'General Discussion' started by smile, Nov 13, 2004.

  1. smile

    smile Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    0
    I'm facing some problem with the SSI.

    When I make shtml file and the include html files happen to be in the same
    directory, they work fine. For eg: in http://www.mydomain.com/one/index.shtml
    include file top-menu.html is present in the same directory and it is
    working fine.

    But it doesn't works when I'm calling the SSI from a second directory for example http://www.mydomain.com/two/index.shtml does not work. How can I configure the Apache so that it calls the include file from sub directories.
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Just use the absolute path to the file relative to the public_html directory and start with a /, like:
    /one/top-menu.html
     
  3. smile

    smile Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    0
    I already tried that but it doesn't works.

    Somebody told me that I have to make changes in the apache.conf to make the SSI work on subdirectories or dirs which are one level below.
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That's weird. Are you putting it like this:
    Code:
    <!--#include virtual="/3rdworld/options.html" -->
    Go to http://www.helpinggodschildren.com/abuse/ and you will see the drop down menu at the bottom. I intentionally put the include file in a different directory to test.

    That page is in the abuse subdirectory, but uses a file from the 3rdworld subdirectory.
     
Loading...

Share This Page