I am currently trying to simulate the behavior of a folder / files in rails using a category / article scheme. So, I have this in the routes:
match '/:category/' => 'category#list_articles'
match '/:category/:article.:format' => 'article#show'
Basically, request the urls:
http:
http:
Everything is working. The problem is that it works well. A URL, for example http://www.example.com/category(without a trailing slash), also serves in the list of articles. Is there a way to block this from 404 or is it better to redirect to a category with a trailing slash?
Using Rails 3, nginx, ruby 1.9.2. Thank!
source
share