Say you’re hosting a refinerycms site on Heroku, and would like to rewrite all admin access to use Heroku’s free piggyback SSL.
Say also that you have a few different environments, accessible via your own domain (http://mysite-dev.mydomain.com). The following in your application controller seems to do the trick: