Skip to main content
New Participant
May 9, 2007
Answered

IIS Virtual DIrectories and Shared Scope Vars

  • May 9, 2007
  • 2 replies
  • 590 views
Hello

I posted this about a year ago, but got it working on a server of ours - now on a new server, same problem, and cant figure out why.

Very simple:

We have multiple sites:

Site 1
Site 2
Site 3
Etc...

Each is in its own directory structure, has its own application.cfm, etc.

Each one has a virtual mapping in IIS to a directory called COMMON, that has some shared code. So within the IIS site for each site, there is a Virtual Directory mapping to this "Common" directory.

Now, in the directory for COMMON, we have coldfusion code that we want to be able to access the scoped variables (such as application, request, etc) of each individual site when called from that site.

So in the COMMON directory, there is an APPLICATION.CFM file that has one line:

<cfinclude template="/application.cfm">

This works flawless on one production server, but on another, we just get an error:


Could not find the included template /application.cfm.
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.

The error occurred in D:\hostedsites\clientsites\common\Application.cfm: line 2

1 :
2 : <cfinclude template="/application.cfm">
3 :


For my life, I cannot figure out why. On the server that DOES work, we have no special CUSTOM TAG PATHS, no MAPPINGS,.and it works joyfully - its only on this new server.

We are using CF version 7,0,2,142559 and IIS 5.0.

Help is needed and appreciated!

Thanks,

Ben
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    Do you have a "/" mapping on one server or the other? This is a default
    mapping created during installation IIRC.

    You could either have it on the working server and it needs to be on the
    new server or you could have it on the new server and it needs to NOT be
    there since it is incorrectly redirecting the files, or it could be on
    both but points to two different locations.

    2 replies

    New Participant
    May 9, 2007
    That was it!

    We had a CF Mapping to "/" that was wholly unused/unnecessary -thanks for the help!
    Newsgroup_UserCorrect answer
    Inspiring
    May 9, 2007
    Do you have a "/" mapping on one server or the other? This is a default
    mapping created during installation IIRC.

    You could either have it on the working server and it needs to be on the
    new server or you could have it on the new server and it needs to NOT be
    there since it is incorrectly redirecting the files, or it could be on
    both but points to two different locations.