Home > Back-end >  I can't redirect the HTTP domain to the HTTPS domain
I can't redirect the HTTP domain to the HTTPS domain

Time:06-17

So I have a problem with my domain. I have a ruby on rails Heroku app and bought a domain from google domains. I can't get "http://www.myapp.com" to redirect to "https://www.myapp.com" I tried to forward the HTTP version from google to the HTTPS version from Heroku multiple times but the website just ends up not working at all. Any help would be fantastic!

CodePudding user response:

If you want your entire application to be served over https then you can set force_ssl config

# config/environments/production.rb
Rails.application.configure do
  # [..]

  # Force all access to the app over SSL, use Strict-Transport-Security,
  # and use secure cookies.
  config.force_ssl = true
end

You can refer to this article for more info.

  • Related