【发布时间】:2009-08-19 00:24:40
【问题描述】:
我在旧版静态 HTML 站点的 URL 上都有一堆过期内容,所有内容都以 .html 结尾:
example.com/a.html
example.com/b.html
而不是显示 Rails 错误页面:
Routing Error
No route matches "/a.html" with {:method=>:get}
我想将所有以.html 结尾的内容重新路由到首页(根路由):
map.root :controller => 'home', :action => 'index'
是否可以仅通过更改路由定义来做到这一点,还是必须define a catch-all route?
【问题讨论】:
标签: ruby-on-rails routing