Put this in a before filter in the ApplicationControlller:
class ApplicationController
before_action :redirect_if_old
protected
def redirect_if_old
if request.host == 'old.com'
redirect_to "#{request.protocol}new.com#{request.fullpath}", :status => :moved_permanently
end
end
end