Forum: Ruby on Rails Migrating to rails... best way to redirect old urls?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Philip H. (Guest)
on 2006-06-10 04:05
(Received via mailing list)
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
Carmen -. (Guest)
on 2006-06-10 20:54
> 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..
Ezra Z. (Guest)
on 2006-06-10 23:25
(Received via mailing list)
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
> removed_email_address@domain.invalid
> 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
This topic is locked and can not be replied to.