May 16, 2007 at 5:04 pm · Filed under Rails tips
This is how we issue 301 in Rails
These icons link to social bookmarking sites where readers can share and discover new web pages.
Permalink
May 28, 2007 @ 8:21 pm
you can do
head :moved_permanently, :location => ‘http://www.newdomain.com’
May 28, 2007 @ 8:23 pm
Much better, thank you
November 15, 2007 @ 10:58 pm
Another method, as of [7820] on 2007/10/09
# Examples: # redirect_to post_url(@post), :status=>:found # redirect_to :action=>’atom’, :status=>:moved_permanently # redirect_to post_url(@post), :status=>301 # redirect_to :action=>’atom’, :status=>302
http://dev.rubyonrails.org/changeset/7820
RSS feed for comments on this post · TrackBack URI
Name (required)
E-mail required)
URI
PJ Hyett said,
May 28, 2007 @ 8:21 pm
you can do
head :moved_permanently, :location => ‘http://www.newdomain.com’
admin said,
May 28, 2007 @ 8:23 pm
Much better, thank you
Matt Scilipoti said,
November 15, 2007 @ 10:58 pm
Another method, as of [7820] on 2007/10/09
# Examples:
# redirect_to post_url(@post), :status=>:found
# redirect_to :action=>’atom’, :status=>:moved_permanently
# redirect_to post_url(@post), :status=>301
# redirect_to :action=>’atom’, :status=>302
http://dev.rubyonrails.org/changeset/7820