Reputation: 19713
In routes.rb
. How do I pass the :301
/ :moved_permanently
to the following route definition?
match '/(*path)', :to => redirect { |params, request| Addressable::URI.escape request.url.sub(request.host, "www.#{request.host}") }
Upvotes: 0
Views: 38
Reputation: 15771
redirect
accepts options. One of them is :status
:
redirect(:status => 301) { |params, request| ... }
Upvotes: 1