我想重定向一些指向我public在 Rails 中的文件夹的链接。
例如:
http://site.com/example应该重定向到http://site.com/example/index.html
我只想对我的公用文件夹的内容执行此操作。
我在 config/routes.rb 文件中试过这个:
match "*pages" => redirect("/%{pages}/index.html")
但它进入了重定向循环。所以http://site.com/example重定向到http://site.com/example/index.html哪个也重定向到http://site.com/example/index.html/index.html等等。