Redirection

You can perform redirection in Rails routes as follows:

4.0

get '/stories', to: redirect('/posts')

4.0

match "/abc" => redirect("http://example.com/abc")

You can also redirect all unknown routes to a given path:

4.0

match '*path' => redirect('/'), via: :get# orget '*path' => redirect('/')

4.0

match '*path' => redirect('/')

results matching ""

    No results matching ""