Link to home
Start Free TrialLog in
Avatar of cducker
cducker

asked on

Setting CF Mappings Per Application

Does anyone know if it's possible to set a cf mapping per application?

For example, say to you have 2 different sites running on the same machine with the following directory structure.

/wwwroot/site1
/wwwroot/site1/Application.cfm

/wwwroot/site2
/wwwroot/site2/Application.cfm

Is it possible to set a different mapping for "/" in each respective Application.cfm.

In site1, I'd like to map "/" to "/wwwroot/site1/" and in site2 I'd like to map "/" to "/wwwroot/site2/".

Image that you inheirt code from 2 different applications and both use the "/" mapping, how do you propose to get both these apps running without having to change a bunch of code.

Thanks.
Avatar of anandkp
anandkp
Flag of India image

Yes u can - just add a new mapping - name it as

1. /site1root/ & map it to "/wwwroot/site1"
2. /site2root/ & map it to "/wwwroot/site2"

this wld enable u to access ur code individually in both the applications !

U can also do the same for ur WebServer mappings ...

let me know ...

K'Rgds
Anand

PS : i dont know what do u mean by "Is it possible to set a different mapping for "/" in each respective Application.cfm"
Avatar of cducker
cducker

ASKER

Anand,

Thanks for the response.
I know I can create to mappings /site1root/ and /site2root/, but that won't solve my problem elegantly.

To be more specific, site1 and site2 are on the same server and running under different Applications.

/wwwroot/site1/
/wwwroot/site1/customtags/test/test.cfm

/wwwroot/site2/
/wwwroot/site2/customtags/test/test.cfm

The test.cfm custom tag has the same name in both applications, but the file's content is different. That means I can't put them both in a global custom tags directory because they do slightly different things.

Each site contains several imports, e.g. <cfimport taglib="/customtags/test" prefix="test" />.

I understand that I could go through each site and respectively replace all the cfimports with <cfimport taglib="/site1root/customtags/test" prefix="test" />, etc, but I don't want too. I'd rather create a mapping for "/" in each of the 2 sites. That way I don't have to change any code.

Please let me know if this makes sense? I also understand that I could also rework all the code to use cfmodule, but I have read that cfmodule is much slower in CFMX than cfimport.

Thanks.




Avatar of cducker

ASKER

Anand,

Thanks for you help, but I've found my solution. I will run multiple instances of CFMX; that way each site can have it's own settings. It appears that there are also some other advantages to doing this.

http://www.macromedia.com/devnet/mx/coldfusion/j2ee/articles/multiple.html

Thanks again,
Cory
NO Objections !
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial