tobmatth/rack-ssl-enforcer — Issue #34: Redirect not working
Author: hallmatt
Created: 2012-03-07 16:45:58+00:00
State: open

I'm trying to use this gem to enforce the SSL on the site. If I got to mydomain.com, it correctly redirects me to https://www.mydomain.com. Once I'm there, if I take off the www. and just go to http://mydomain.com, it renders the site at http://mydomain.com, which breaks the SSL since the SSL only works with the WWW subdomain.

Here's what I have in my production.rb file:

config.middleware.use Rack::SslEnforcer, :redirect_to => 'https://www.mydomain.com', :strict => true

Any thoughts on how I can force the site to always render https://www.mydomain.com?

Thanks!