在routes.rb
。如何将:301
/ :moved_permanently
传递给以下路线定义?
match '/(*path)', :to => redirect { |params, request| Addressable::URI.escape request.url.sub(request.host, "www.#{request.host}") }
答案 0 :(得分:1)
redirect
接受选项。其中之一是:status
:
redirect(:status => 301) { |params, request| ... }