Skip to main content
Inspiring
June 27, 2011
Question

Server-side includes not working

  • June 27, 2011
  • 1 reply
  • 709 views

Running CF9.x on Apache 2.2 Win 7.

I inherited an older html multiple page site that we are breaking down into includes using html server-side includes:

e.g. <!--#include file="includes/sidebar.html" -->,  and saving the page as a .html file, which is then <cfincluded> in a .cfm file.

Is there a way to get <!--#include file="includes/sidebar.html" --> include working on a CF page? All I see is the contents of the page, but none of the sidebar.html, or header.html, etc.

I know I could switch to cfincludes, but the boss LOVES to muck around with the html side of things.

TIA,

Doug

    This topic has been closed for replies.

    1 reply

    Inspiring
    June 27, 2011

    I know I could switch to cfincludes, but the boss LOVES to muck around with the html side of things.

    All the more reason to do it, surely?

    But anyway...

    I've never used a server-side include, but it looks to me that they just load the file and return it at that position in the document.

    For CF code to be executed, the file needs to be REQUESTED, so it won't be a starter with server-side includes.

    --

    Adam