How can I route /foo to display /public/foo.html in Rails?
/foo
/public/foo.html
You can do this:
Add this, into your routes.rb file.
match '/foo', :to => redirect('/foo.html')
Update
In Rails 4, it should use "get", not "match":
get '/foo', :to => redirect('/foo.html')
thanks Grant Birchmeier
1.4m articles
1.4m replys
5 comments
57.0k users