Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    156
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. smile

    smile Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    156
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice