Redirect from HTTPS to HTTP

Hi guys,

I have a signup process which is done through HTTPS. The last page of the process does not require the request to be SSL enabled so I am wondering how I would achieve redirecting from an HTTPS page.

My code looks like this: setNextEvent(event=‘verify/contact/success’,persist=‘pagetitle,firstname,lastname,username,contact,user’);

verify/contact/success is defined as a route. I know there is a new setting in routes to force a route to be SSL, but what about the other way around?

Thanks.

Nolan

In my ColdBox Config, I create a setting of “allowed SSL event.actions” and I have an interceptor that, if the request is SSL, checks to see if the target action is allowd to be SSL using Event.getCurrentEvent() (pretty sure thats the all).

// Example ColdBox.cfc
settings = {

allowedSSLRegEx = “^login|^cart”;
}

// Interceptor
if (reFindNoCase(getSetting(“allowedSSLRegEx”),Event.getCurrentEvent()) == 0) {
// redirect to non-ssl
}

setNextEvent has an 'ssl' parameter you can pass (if it is not set, it
will send it to whatever mode the current event is in), so

setNextEvent(event='verify/contact/
success',persist='pagetitle,firstname,lastname,username,contact,user',ssl=false);

should do the trick.

You can also go the route of an interceptor if you want to control
this programatically later on.

Is this what you are asking?

Hi Aaron,

That makes sense, however i’m confused how to do the redirection using setNextEvent() forcing it to go to non HTTPS. By default setNextEvent redirects to whatever the current request is set to. In this case HTTPS.

Thanks!

Nolan

Hi Cory,

Yes. I will try out that parameter. Looks like it should do the trick.

Thanks!

Nolan

Guess I should have read the question better :slight_smile:

if you explicitly set ssl=false, then it will remove the SSL for you.

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