mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Update Rails routing guide to mention that redirect() is a 301 permanent redirect
I had to try out myself to realize that it's 301, so this should be helpful to everyone.
This commit is contained in:
@@ -596,6 +596,8 @@ match "/stories/:name" => redirect {|params| "/posts/#{params[:name].pluralize}"
|
||||
match "/stories" => redirect {|p, req| "/posts/#{req.subdomain}" }
|
||||
</ruby>
|
||||
|
||||
Please note that this redirection is a 301 "Moved Permanently" redirect. Keep in mind that some web browser or proxy server will cache this type of redirect, make the old page inaccessible.
|
||||
|
||||
In all of these cases, if you don't provide the leading host (+http://www.example.com+), Rails will take those details from the current request.
|
||||
|
||||
h4. Routing to Rack Applications
|
||||
|
||||
Reference in New Issue
Block a user