How to remove a URL's trailing slash in a Rails app? (in a SEO view)
问题 In order to avoid content duplication, I would like to avoid the pages of my site being accessible by several URLs (with or without trailing slash). Currently, the URLs catalog/product/1 and catalog/product/1/ lead to the same page. My goal is that the second URL redirect to the first (redirection 301, of course). None page of my site should be accessible with a trailing slash, except my home page / obviously. What is the best way to do this? Using .htaccess or routes.rb? How would you do