This question has been asked in various permutations, but I haven\'t found the right combination that answers my particular question.
You should have a look at rack-rewrite - it's essentially Apache re-write but in Ruby form, and usable on Heroku.
This will allow you to create all sorts of Rack level rules and what redirections etc should occur and when.
you can redirect to a different hostname by doing the following:
# file: controllers/application_controller.rb
class ApplicationController < ActionController::Base
force_ssl :host => "secure.example.com"
end
see: rails force_ssl source for more info