Hi, I am changing a very standard old school website to rails. When I make the change to rails, all of the old urls will not be valid. If a person has a bookmark to an old web page I would like them to be directed to the front page of the new website www.domain.com. How do I do this? Do I do something in routes.rb? Thanks, Peter
You could just change your public/404.html page to add a meta redirect. I would probably recommend putting in a slight delay so legitimate 404''s don''t cause people to be redirected without an explanation. Tom On 4/26/06, Peter Michaux <petermichaux@gmail.com> wrote:> Hi, > > I am changing a very standard old school website to rails. When I make > the change to rails, all of the old urls will not be valid. If a > person has a bookmark to an old web page I would like them to be > directed to the front page of the new website www.domain.com. How do I > do this? Do I do something in routes.rb? > > Thanks, > Peter > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tom Davies http://blog.atomgiant.com http://gifthat.com
Hi Tom, For example, a missing action error doesn''t seem to produce my 404.html page anyway. I could use the flash and then redirect to the front of the site. However I still don''t know where to do the "catch all" Peter On 4/26/06, Tom Davies <atomgiant@gmail.com> wrote:> You could just change your public/404.html page to add a meta > redirect. I would probably recommend putting in a slight delay so > legitimate 404''s don''t cause people to be redirected without an > explanation. > > Tom > > On 4/26/06, Peter Michaux <petermichaux@gmail.com> wrote: > > Hi, > > > > I am changing a very standard old school website to rails. When I make > > the change to rails, all of the old urls will not be valid. If a > > person has a bookmark to an old web page I would like them to be > > directed to the front page of the new website www.domain.com. How do I > > do this? Do I do something in routes.rb? > > > > Thanks, > > Peter > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Tom Davies > > http://blog.atomgiant.com > http://gifthat.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hi Peter, The 404 should work for any missing pages. One thing worth mentioning is if you are running in development mode Rails will render a built-in 404.rhtml for missing actions. However, in production mode, it will render the public/404.html. For your original question about stale URLs to the old site, they should be handled adequately by the public/404.html. Try changing your environment to production and try it again. Let me know if you have any questions. Tom On 4/26/06, Peter Michaux <petermichaux@gmail.com> wrote:> Hi Tom, > > For example, a missing action error doesn''t seem to produce my > 404.html page anyway. > > I could use the flash and then redirect to the front of the site. > However I still don''t know where to do the "catch all" > > Peter > > On 4/26/06, Tom Davies <atomgiant@gmail.com> wrote: > > You could just change your public/404.html page to add a meta > > redirect. I would probably recommend putting in a slight delay so > > legitimate 404''s don''t cause people to be redirected without an > > explanation. > > > > Tom > > > > On 4/26/06, Peter Michaux <petermichaux@gmail.com> wrote: > > > Hi, > > > > > > I am changing a very standard old school website to rails. When I make > > > the change to rails, all of the old urls will not be valid. If a > > > person has a bookmark to an old web page I would like them to be > > > directed to the front page of the new website www.domain.com. How do I > > > do this? Do I do something in routes.rb? > > > > > > Thanks, > > > Peter > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > > Tom Davies > > > > http://blog.atomgiant.com > > http://gifthat.com > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tom Davies http://blog.atomgiant.com http://gifthat.com