is it possible to replace index.cfm by something else?if yes, then how?

everything is in the title i guess :slight_smile:

Sorry, but your title doesn’t really ask a full question. When you say “else”, what do you mean as opposed to?

As opposed to a rewrite engine?
No, you have to use a rewrite engine.

As opposed to IIS rewrites?
Yes, there is an ISAPI rewrite engine that I’ve used on older versions of IIS that uses a similar config file to mod_rewrite

As opposed to IIS in general?
Yes, you can switch to Apache web server and use mod_rewrite. Nginx also has rewrites.

As opposed to a web server-based rewrite engine?
Yes, you can install Tuckey rewrite which is a servlet filter written in Java that you configure in your servlet container.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

yep, default document and changing the rewrite rules will work.

ok i guess it wasn’t enough explicit.
I’m trying to merge an old app into coldbox.
But the old app already uses index.cfm as homepage
So i just wanted to keep it like that and just use another file for the framework let’s say a fw.cfm file.
so i can’t change default document in web.config as it as to stay on old index.cfm file as there might be links to that page
so i changed the rewrite rule to use a fw.cfm file, added following in the application.cfc onrequeststart

<cfif( findNoCase(‘fw.cfm’,listLast(arguments.targetPage,"/")) )>
<cfset application.cbBootStrap.processColdBoxRequest()>

and so coldbox requests are working as other legacy cfm file

Except the index.cfm file which fires some coldbox request.
How can i avoid that ?

Ah yes, not at all what I guess when I read your subject line. Especially since you had just started another thread dealing with URL rewrites.

The index.cfm is called a “front controller” in the framework world and no, it can’t be changed currently in ColdBox. Honestly, I’m not sure why not. If I recall, even FuseBox 3 let me change the front controller. A quick search shows it’s hard coded about 11 places or so in the core framework code. You should put in a ticket for us to make that a setting:

http://blog.coldbox.org/blog/how-to-create-a-jira-account-and-enter-coldbox-tickets

So, if a user hits yoursite.com with no path, do you want them to get the ColdBox site, or the legacy site? You should be able to tweak the if statement you referenced in Application.cfc to ignore or pay attention to that URL as needed. For instance, if the file is the root index.cfm and there is no path info or “event” in the query string, then DON’T process ColdBox.

Another alternative is to put the new ColdBox app in a subdirectory, though you may not want your URLs to reflect that.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Maybe you need to work on how you explain your problem.

If it was me, mixing the two is going to cause a huge nightmare, especially on a maintenance path. Your best course of action is to migrate small chunks into ColdBox, separating the two entry pints into the application. If you have old and new sharing the same entry points, I would not like to be maintaining that Application.

Indeed i can avoid coldbox processing request in the onrequestart method of the application.cfc based on the the target page.
But then i have some strange behaviour as not output is displayed except when i use a dump. Normal output fails.
Any idea why?

In fact i need to share session variables between those two apps, so my idea was to put everything together.
I have a lot of constraints in terms of urls, and things to keep the way they are, so it’s not easy to handle i guess.

That is probably because of the

If your legacy code doesn’t have that may be the issue. Try commenting it out and see what happens.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

nope it doesn’t do the trick…legacy code has cfoutput and i even tried by setting the enablecfoutputonly setting to no
but it still only displays dump but nothing more
don’t understand what’s happening there

I’m not sure what to tell you then. I just tried it locally and it appears to work fine. I took one of our application templates using non-inheritance and modified onRequestStart to look like this:

<cfif arguments.targetPage eq ‘/index.cfm’ and cgi.path_info neq ‘’ >
<cfset application.cbBootstrap.reloadChecks()>
<cfset application.cbBootstrap.processColdBoxRequest()>

http://scribble.dev/index.cfm/Main
Gives me the main.index event in my ColdBox app

http://scribble.dev/
Gives me my “legacy” index.cfm page

and http://scribble.dev/test.cfm
Gives me my “legacy” test.cfm page.

Perhaps you can create a simple stand-alone example site, zip it up, and send it to the list so we can see your code. There must be something else going on.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com