SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I implement Server Side Includes on pages in a sub directory?

    I have set up my home page with the head, menu and footer as SSI. I want to use these same htm files for my /information/index.shtml file as well. But its looking for the files in the subdirectory. Obviously making a copy of the files would work, but that kind of defeats the purpose of SSI.

    Any ideas?

    Thanks.

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great Dane
    Gokhan ARLI

  3. #3
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use root relative addressing.

    I think that's the term for it...

  4. #4
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The answer to your problem is simple.

    When you want to include a file which is in the same directory, use -

    <!--#include file="header.html" -->

    otherwise, to reference a file in another directory, use -

    <!--#include virtual="/includes/header.html" -->

    where the path you supply is with reference to the Root directory.

    Go to http://www.stars.com/Authoring/SSI/Intro/include.html for a more detailed explanation of the above

    Cheers...
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually that depends on your hosting provider. some require to save your ssi in a cgi-bin,

    rgds,
    markus
    ------------------------
    http://www.webtipz.com/
    ------------------------
    is a resource for every internet marketing specialist and manager in the ebusiness. You will find regular updated information how to get more hits, how to increase your revenue over the web and how to develop your brandmark. Find out more about WAP and PalmPilot Software.
    -----------------------------------------------------------------------

  6. #6
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for that.

    This kind of spills over though. If my SSI file to be included links to images/foo.gif that works fine on the home page. But not on the subdirectory pages. Then I need ../images/foo.gif

    Is it possible to have universal links, or do I need a separate file to include?
    And what does that root referencing stuff someone mentioned do? I thought about using a base tag, but that didn't help much.

  7. #7
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Just use /images/foo if your images directory is located directly off your root web directory.
    Wayne Luke
    ------------



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
  •