2 Replies Latest reply on Dec 27, 2006 8:50 PM by BKBK

    CFINCLUDE and relative path

      I have a website which has error catching in it and from time to time I have this error come through when using cfinclude.

      Could not find the included template project56/images1/page1.html. Note: If you wish to use an absolute template path (e.g. TEMPLATE="/mypath/index.cfm") with CFINCLUDE then you must create a mapping for the path using the ColdFusion Administrator. Using relative paths (e.g. TEMPLATE="index.cfm" or TEMPLATE="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible.

      Why would this error occur for a few visiters and not for all when browsing my website?
      If I have to put some sort of mapping into CF Administrator what should I put as a mapping and why should this help?

      Thanks in advance for your help.

        • 1. Re: CFINCLUDE and relative path
          AirJar Level 1
          The only thing I can think of is are you sure the page the 'affected' users are clicking from are in a parent folder of the 'project56' folder? The error occurs when the CFINCLUDE is looking in the wrong folder or when you try to include URL variables in the include statement.

          if you INCLUDE project56/images1/page1.html it will work, but if you INCLUDE project56/images1/page1.html?user=123 then you get an error because the INCLUDE looks for the actual text of what's between the quotation marks...it will not pass variables.

          I'd check the folder structure on where they are clicking from. In your error page, just have the referring page output.
          • 2. Re: CFINCLUDE and relative path
            BKBK Adobe Community Professional & MVP
            Air Jar is right about users clicking from the project56 folder. Follow Coldfusion's hint and create a mapping in the Coldfusion Administrator.