« Previous Next »

Thread: SSI Server Side Includes -- Not working as advertised

Last post 11-15-2007 9:32 AM by sdeliasr. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 11-14-2007, 5:35 PM

    • sdeliasr
    • Not Ranked
    • Joined on 11-14-2007, 10:23 AM
    • Posts 4

    SSI Server Side Includes -- Not working as advertised

    I'm trying to use SSI and am finding that the include statement is being treated as a comment.  I can see it in "View Source" intact, the same as in the source file.

     I've tried this under WinXP Pro and Windows Server 2003.  Under the latter, I went into "Web Service Extensions" and allowed SSI.

    Inside IIS, the virtual directory is taking the defaults that shows that the .shtml file extension points to the ssinc.dll

    I know that this works with ASP pages, but I need to get it to work with an .html file as the "parent" page that is including a .shtml file.

    I can send/show the sample code I'm using if that would help.

     I've been googling and searching this issue like crazy and still haven't found anything close to explaining this.

     Thanks in advance!

    Steve Delia

     

  • 11-15-2007, 8:43 AM In reply to

    Re: SSI Server Side Includes -- Not working as advertised

    Show code.  This should work fine:

     test.shtm
    -----------------

    <html><head><title>Test Include</title></head>
    <body>
    <p>This was in the original file</p>
    <!--#include virtual="include.inc" -->
    </body></html>

    include.inc
    ------------------

    <P>This is an included line</p>

    Put them both in the root folder and call the first by name.  Remember, only the extensions SHTM and SHTML work for the file to process HTML includes.  I use INC as the extension for included files for clarity, they can be anything with HTML code.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 11-15-2007, 9:32 AM In reply to

    • sdeliasr
    • Not Ranked
    • Joined on 11-14-2007, 10:23 AM
    • Posts 4

    Re: SSI Server Side Includes -- Not working as advertised

    Thank you a thousand times over. 

     The problem was in my understanding of how this works.

    I INCORRECTLY thought that I needed to add the file extensions of the files BEING INCLUDED into Applications Mapping screen of IIS (under Home Directory -> Configuration).

     So I added ".shtml" when I should have added ".html" to the mappings to ssinc.dll.

     Works for me now!!!

     Steve Delia

Page 1 of 1 (3 items)
Microsoft Communities