regenerating url in cf9/Coldbox
Posted
by faheem7860
on Stack Overflow
See other posts from Stack Overflow
or by faheem7860
Published on 2010-06-04T17:31:40Z
Indexed on
2010/06/05
15:52 UTC
Read the original article
Hit count: 300
Hi I am wondering if there is a way to regenerate the URL when any page is loaded in coldbox/CF9 when using event.buildLink ?
Currently I get http://cawksd05.codandev.local:8080/entries/editor when using event.buildlink.
But the correct url should have /index.cfm added to it as shown below:
/index.cfm/entries/editor
Is there a way to set this once and where does this get set as I am confused where to set this for all my pages so that /index.cfm gets added the the url prefix when I do an event.Buildlink.
Thanks Faheem
// General Properties
setUniqueURLS(false);
setAutoReload(false);
// Base URL
if( len(getSetting('AppMapping') ) lte 1){
setBaseURL("http://#cgi.HTTP_HOST#/index.cfm");
}
else{
setBaseURL("http://#cgi.HTTP_HOST#/#getSetting('AppMapping')#/index.cfm");
}
// Your Application Routes
formatConstraints = {format="(xml|json)"};
addRoute(pattern="/api/:format/tasks/completed",handler="tasksAPI",action="list",constraints=formatConstraints,completed=true);
addRoute(pattern="/api/:format/tasks",handler="tasksAPI",action="list",constraints=formatConstraints);
addRoute(pattern="/api/:format?",handler="tasksAPI",action="invalid");
addRoute(pattern="/tasks/list/:status?",handler="tasks",action="index");
addRoute(pattern=":handler/:action?");
© Stack Overflow or respective owner