is it possible to set different BaseURL's based on environment?
yes, you will have to intercept at preProcess() and override the base URL for that request via the event request context object:
event.setBaseSESURL()
You can also look at forgebox, there is already a multi domain interceptor there.
Luis F. Majano
President
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com
I am not sure that I follow can you post an example?
is it like this
function development(){
event.setBaseSESURL()
}
hi,
i can't get my sample-app running on coldbox 3 m5, when placing it
in a different root folder ... :
webroot example
/webdata/domain.com/htdocs
approot example
/webdata/domain.com/htdocs/db-app
i tried all kind of settings in Application.cfc with relative & absolute paths
and coldfusion-mappings.
last setting says "can't find modules.forgebox.ModuleConfig".
or Error Messages: invalid component definition, can't find handlers.Main
my settings:
<cfset COLDBOX_APP_ROOT_PATH = '/webdata/domain.com/htdocs/db-app/'>
<cfset COLDBOX_CONFIG_FILE = "/db-app/config/Coldbox.cfc"> (with a cf-mapping on /db-app)
i also tried the other way around without success:
webroot example
/webdata/domain.com/htdocs
approot example
/webdata/domain.com/db-app
running the APP in "normal" folder-structure works correct and painless.
regards,
daniel
lists@platform.ch
Like this in an interceptor:
<cffunction name="preProcess" access="public" returntype="void"
hint="Executes before any event execution occurs" output="false" >
<cfargument name="event">
<cfargument name="interceptData">
<cfscript>
// set the base URL according to domain or whatever strategy you like.
arguments.event.setSESBaseURL("http://" & cgi.http_host & "/index.cfm");
</cfscript>
</cffunction>