Not been around for a while but I’ve just started a rather large ColdBox application so you might find me asking stupid questions for a while.
I have a couple of little annoying bits of behaviour in the application and I’m hoping someone can tell me what I’ve missed.
First I have a security interceptor which redirects after login to the _securedURL variable. When navigating to the base url (http://www.domain.com/) I get a _securedURL value of http://www.domain.com/index/cfm which causes an error because I don’t have a handler called index. I know I could add a route to point it to the default event but this would still leave index/cfm in the url. Another option would be to check for index/cfm before redirecting and remove it.
How have you dealt with this before?
My other query is I have set my defaultEvent as “”. but when using setNextEvent(defaultEvent); it always redirects to http://www.domain.com/main/index how can I force this to redirect to http://www.domain.com/ without the main/index?
The index is added, if you have this in the routes file. In the config folder you will see Routes.cfm, all you need to do is remove index.cfm from there.
Yeah I was guessing I had this issue years ago, just out of curiosity what version of ColdBox are you using. Is there any chance you can upgrade to the latest and try it again?
I know ContentBox suffered from this exact problem when it was first released, Luis has since fixed it but I never looked at what he actually did to fix this.
Can you check the source of the outputted html and see if there is a baseURL it might contain it. I do recall something with the baseURL when the _securedURL was generated and I patched this ColdBox and raised an issue with Luis. I thought he may have fixed this by now.
If it is in the baseURL then you need to load up coldbox.system.interceptors.Security.cfc
Around lines 232-250 is where all this takes place, this should have no reference to index in these lines of code.
Yeah, that is what I have. I went looking to see if I still have the patch, but can’t find it.
Just out of curiosity, did you re-install the connectors for CF when you updated. The cgi path stuff has caused issues in the past, but this doesnt sound like that sort of problem.
I know at one stage I used an interceptor on the preRequest or preEvent, to just remove the index.cfm from that variable if using SES, but I can’t even find that so it has me stumped.
I’m pretty sure I reinstalled the connectors, I’ve had the issue with them in the past. Though I reinstalled them again just to make sure and path_info is still /index.cfm I think for now I will use an interceptor and remove it.
Yeah this is a mystery, I have a condition where ContentBox when it has timed out of the dashboard and you log in does something similar. Except it redirects back to the dashboard, it is like it goes from SSL to non SSL back to SSL somehow and Luis says he can’t duplicate that. Just wonder if it is related in some way, doubt it though.