setNextEvent() Sub-domains

Hey Everyone,

I am having an issue with setNextEvent and it redirecting to the wrong
subdomain.. I have Apache configured with wildcard subdomains,
everything works fine unless you are redirected through

Here is the issue, say you went to and then you were
moved to, everything works fine you can go navigate
around the site but when you are redirected via setnextevent your
would be moved back to

I also notice that all setNextEvent redirects use Status 302 Moved
Temporarily. Not sure if this is part of the issue.


Heath, are you saying you have an app that responds to two different domains?

If so, you need to switch the domain context on each request as the app could be responding requests for multiple domains. We have a multi domain SES interceptor in forgebox that can help you on this. The problem lies in that the setNextEvent uses the value in the request context which in turn is the value in your routes.cfm. As you requests can switch domain you need to switch it in the request context as well.

event.setSESBaseURL( domain1 or domain 2)

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:


Hi Luis,

Thank you for the response. There is only one actual domain with many dynamic subdomains. Each user will have an account with their own subdomain which styles the site to their brand.

My problem is setnextevent always sends the user back to whatever address they entered the site at. So if they typed in and then went over to they would be redirected back to when they came across a setnextevent().

Thank You,