• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFINCLUDE and relative path

Explorer ,
Dec 18, 2006 Dec 18, 2006

Copy link to clipboard

Copied

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.
TOPICS
Advanced techniques

Views

551

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 27, 2006 Dec 27, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2006 Dec 27, 2006

Copy link to clipboard

Copied

LATEST
Air Jar is right about users clicking from the project56 folder. Follow Coldfusion's hint and create a mapping in the Coldfusion Administrator.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation