Skip to main content
Inspiring
December 18, 2006
Question

CFINCLUDE and relative path

  • December 18, 2006
  • 1 reply
  • 758 views
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.

Simon.
This topic has been closed for replies.

1 reply

Inspiring
December 28, 2006
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.
BKBK
Community Expert
Community Expert
December 28, 2006
Air Jar is right about users clicking from the project56 folder. Follow Coldfusion's hint and create a mapping in the Coldfusion Administrator.