We have something like this that would probably work for you in our
routes.rb file.

if Rails.env.production?
    hostname = 'my_canonical_url.com'
    constraints(WwwConstraint.new(hostname)) do
      root :to => redirect("http://www.#{hostname}";)
      match '/*path', :to => redirect {|params| "
http://www.#{hostname}/#{params[:path]}"}
    end
elsif Rails.env.staging? ...

Mike

On Thu, Feb 3, 2011 at 2:36 PM, Volkan Unsal <spockspla...@gmail.com> wrote:

> I have two domain names assigned to my heroku app. I want to make sure
> that all requests to one domain are permanently redirected to the
> other domain. How can I do that on Heroku?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to heroku@googlegroups.com.
> To unsubscribe from this group, send email to
> heroku+unsubscr...@googlegroups.com<heroku%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to