Hi all,
After some debugging, I found what is going wrong here. Not sure if it
is something in the SES Interceptor or in the .htaccess file, so I
thought I would share it with you, to see what you think of it.
My setup is a linux development machine, with Apache, Railo on Resin
and the latest Coldbox milestone.
When I use the SES interceptor with the .htaccess file, it goes wrong
because the interceptors returns a double / in the path_info: //
developer/index/ instead of /developer/index/
When the interceptor loops over this, since the first item is empty it
always goes to the default handler.
My quick fix was to alter the SES interceptor:
<cffunction name="getCleanedPaths" access="private"
returntype="struct" hint="Get and Clean the path_info and script
names" output="false" >
<cfscript>
var items = structnew();
// Get path_info
items["pathInfo"] = getCGIElement('path_info');
items["scriptName"] =
trim(reReplacenocase(getCGIElement('script_name'),"[/\\]index
\.cfm",""));
// Clean ContextRoots
if( len(getContextRoot()) ){
items["pathInfo"] =
replacenocase(items["pathInfo"],getContextRoot(),"");
items["scriptName"] =
replacenocase(items["scriptName"],getContextRoot(),"");
}
// Clean up the path_info from index.cfm and nested pathing
items["pathInfo"] = trim(reReplacenocase(items["pathInfo"],"[/\
\]index\.cfm",""));
if( len(items["scriptName"]) ){
items["pathInfo"] =
replaceNocase(items["pathInfo"],items["scriptName"],'');
}
items["pathInfo"] = replacenocase(items["pathInfo"], "//", "/",
"ONCE");
return items;
</cfscript>
</cffunction>
I added the line:
items["pathInfo"] = replacenocase(items["pathInfo"], "//", "/",
"ONCE")
just before the return.
Or do I have to alter the .haccess? What is the best way, is this a
bug in the interceptor, or just some Apache quirk?
Kind regards,
Erik-Jan