Because of Heroku's apex domain limitations when using their SSL endpoint, I set up DNSimple's Alias to give me root URL functionality.
Now I've got both the root and the www versions of the site up and running over SSL, but I'd like to redirect it all to www., which heroku suggests doing in the (Rails 3.2) app itself.
These are some suggestions floating around for doing this:
- add a before_filter in application_controller.rb
- redirect in the routes.rb file
- use a gem like this one: https://github.com/jtrupiano/rack-rewrite
So what's the best/recommended way to redirect root URL's to www (incl https) in Rails? Details are appreciated since most examples show how to do it the other way around.