Solved

Setting CF Mappings Per Application

Posted on 2003-11-24
6
175 Views
Last Modified: 2013-12-24
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.
0
Comment
Question by:cducker
  • 2
  • 2
6 Comments
 
LVL 17

Expert Comment

by:anandkp
ID: 9815676
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"
0
 
LVL 1

Author Comment

by:cducker
ID: 9818640
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.




0
 
LVL 1

Author Comment

by:cducker
ID: 9819398
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
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9822432
NO Objections !
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9838305
PAQed, with points refunded (125)

Computer101
E-E Admin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now