aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-10-05 15:31:14 -0300
committerPrem Sichanugrist <s@sikachu.com>2011-10-05 15:31:14 -0300
commitd6c7185d77158caee933e84b247e37bb6a67bf58 (patch)
tree37aa999c866d6eff88f0ba676eb955ea6b14aa40 /railties
parent46ce7f1f77b91d3762e7eeab16a19afcb79c8477 (diff)
downloadrails-d6c7185d77158caee933e84b247e37bb6a67bf58.tar.gz
rails-d6c7185d77158caee933e84b247e37bb6a67bf58.tar.bz2
rails-d6c7185d77158caee933e84b247e37bb6a67bf58.zip
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.
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/routing.textile2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index 0a9f1e8388..bf18402b60 100644
--- a/railties/guides/source/routing.textile
+++ b/railties/guides/source/routing.textile
@@ -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