How do I redirect from HTTP to HTTPS?

If you would like to force users to use SSL, your application will need to redirect them to HTTPS.

Written by Chris Oliver
Updated over a week ago
Hatchbox will setup your application to respond to both HTTP and HTTPS requests. 

It is your application's responsibility to handle redirecting to HTTPS if you would like. We do not force users to use SSL because there may be situations where your site needs to be accessible on HTTP. 

Rails
In your config/environments/production.rb, add the following config:
config.force_ssl = true
Other Applications
Check the protocol for "http://" and redirect to the current URL using "https://" instead.

Was this article helpful?