Is it better to use routes or mod_rewrite to forward old urls?

I recently changed some URLs in a Rails application, and I wonder if I should use routes + controllers + redirect_to to forward old URLs or just use .htaccess with Apache mod_rewrite?

I use Apache + Passenger, so htaccess files work, but it was curious if there was a standard for this kind of thing.

FWIW, URLs have been changed: http://example.com/user/joeschmoe

: http://example.com/joeschmoe

+3
source share
2 answers

mod_rewrite, , , Rails. , , , mod_rewrite , , , .

- , mod_rewrite. Ruby, , Rails .

+2

mod_rewrite, , .

( -), ( , .htaccess), httpd.conf ( . htaccess). .

+2

Source: https://habr.com/ru/post/1725214/


All Articles