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?
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.
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.