SSL and SetBaseURL

Is there any way I can move the SetBaseURL from the Routes.cfm file to
the ssl.cfc interceptor? Or, is there any problem with setting the
Base URL to a relative URL without the http_host in it?

I don't want to have to worry about telling buildLink whether it's SSL
or not, I don't want to have to SetBaseURL in one or more handlers,
and I don't want to have to check for event.isSSL.

What I really want is if the handler name is in the regex pattern for
the SSL interceptor, to be relocated to https and for all links on a
page to automatically be https as well ... until the user clicks on a
link that is not in the regex pattern for the SSL pattern... then,
they are redirected back to http.

Am I missing something simple?

Thomas

Nope, you can. Just make sure it intercepts at preProcess() and use the event.setSESBaseURL() to setup the ses base url.

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

Great, it sounds like I'm happily on the right track.

Can you explain, 'make sure it intercepts at PreProcess'? There's a
preEvent in the interceptor, is that what you mean?

Thanks Luis,
Thomas

So I tried to event.setSESBaseURL() in the PreProcess() of the SSL
interceptor, but the SES interceptor complains that...

Element BASEURL is undefined in INSTANCE.
The error occurred in C:\inetpub\wwwroot\ColdBox-Skeleton\coldbox
\system\interceptors\ses.cfc: line 304

I tried putting the SSL interceptor before the SES interceptor in the
coldox config file, but it doesn't seem to matter.

- Thomas

No, it has to be preProcess so it executes at the beginning of the request and ALL the rest of the application can have the correct URL to use.

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

Sorry Luis,

Do you mean PreProcess of the ssl.cfc interceptor? That’s where I have it now, and I’m getting that BaseURL is undefined.

Thomas

Thomas,

You still have to set the base URL in the ses interceptor configuration file: Routes.cfm. This is the default SES URL the system will use. You can then override it a-la-carte using the event.setBaseURL() in the SSL interceptor.

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

Thank you Luis,

Thomas