We have purchased Verisign SSL for a Domain for https://www.domainname.com ; the problem is that it does not work for https://domainname.com. I am using ssl_requirement Gem: https://github.com/rails/ssl_requirement
So I patched the Gem to also redirect non www ones to https://www.domainname.com and it worked well for the following scenarios:
http://www.domainname.com => https://www.domainname.com
http://domainname.com => https://www.domainname.com
But not for the scenario where someone types:
It seems that the server throws error before Rails takes control. Here are the details of the server:
OS: RHEL 5.5
Ruby: 1.9.2
Rails: 3.0.10 (on RVM)
Web Server: Apache with Passenger
Thanks for your help.
Here’s the code I use to redirect from domainname.com to http://www.domainname.com
This goes in the .htaccess file at the root level of the www directory.
Here’s another writeup about SSL in Rails 3.1:
http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/