Hey all -
I’m migrating an app from PHP to Rails and was wondering what the best
way
to redirect the old urls are. I would like to do a 301 as I’m told that
makes Google the happiest.
We’re using lighty as the server and I believe it has rewrite
capabilities, but I can’t get to their site right now.
Anyway, I’m wondering if it’s best handled in lighty? Or by adding a
bunch of routes, or by having a handler catch what would be 404’s then
run
some custom code and if I can find a match, redirect them, otherwise,
return 404.
We have quite a few urls and I’d like to automatically map as many as
possible.
Seems like the last option would be best since it would only happen if
rails didn’t catch it already…
Pointers? Suggestions?
Thanks!
-philip
a handler catch what would be 404’s then run
some custom code and if I can find a match, redirect them, otherwise,
return 404.
id stick with routes.rb rather than inventing your own, since it works
quite well and you can constrain by regex if needed…
We have quite a few urls and I’d like to automatically map as many as
possible.
routes.rb for the ones youd like to keep, and send the rest to the
301/404 bin. redoing a drupal site in rails my threshold was do the
names even make sense. eg /article/tagname was ditched, since id expect
an articleid or shorturl to follow, not a tag… use your judgement, i’m
sure its good…
On Jun 9, 2006, at 5:04 PM, Philip H. wrote:
a bunch of routes, or by having a handler catch what would be 404’s
Thanks!
-philip
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Philip-
There is a funny plugin out there called Legacy Interop. Which
allows your to emulate your old urls. Check it out , it might help
you transition your app over to rails.
http://wiki.rubyonrails.com/rails/pages/Legacy+Interop
-Ezra