-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Oct 29, 2005, at 6:45 AM, Luke Randall wrote:> I''m currently redoing a site using RoR. The current site has a
number
> of pages in the form of x.php, and have set them up in using routes to
> reflect the new urls. However, I''d like Google to start indexing
the
> new url structure so that I can eventually move away from this.
> Therefore, when a http client accesses the any of the old pages
> (x.php) I''d like to return a 301. Using redirect_to returns a 302
> (temporary redirect), and provides no way to alter the status code
> returned.
Unfortunately, redirect_to doesn''t let you pick from the variety of
redirect statuses; however, the underlying response.redirect takes a
permanently flag as its second parameter, so you can do:
response.redirect(named_route_url(:action => ''foo''),
true)
to get a 301 status.
This is ugly and undercuts the usefulness of redirect_to, though.
Please post an enhancement request to http://dev.rubyonrails.org/
newticket.
Thanks,
jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)
iD8DBQFDY9Y2AQHALep9HFYRAm9FAJ9jSI2bon+joxsGMcXPb0JhsIOTowCgpHKf
zAndltTNT/lVbKfmLlLHows=TkMl
-----END PGP SIGNATURE-----