0

I am going to move my web application to a new domain name and want to use 301 permanent redirect for all incoming traffic to the old domain name.
I was going to use a before_filter in the application controller that does a permanent redirect. I was wondering how exactly I would write this to catch all urls and pass them 'as is' to the new domain name.

I am aware this can be done through apache or higher level, but I wanted to know how I would do this from the web application if I needed to.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
  • possible duplicate of [Reroute old content (.html/.php etc.) to Ruby on Rails](http://stackoverflow.com/questions/2063892/reroute-old-content-html-php-etc-to-ruby-on-rails) – Simone Carletti Oct 20 '11 at 10:44

1 Answers1

1

If you can, delegate the job to your web server. Don't use Rails. Otherwise, use Rack Metal.

See

Community
  • 1
  • 1
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364