Reputation: 1687
Perhaps simply due to lack of good keywords, I wasnt able to find any useful solution for a problem that should be almost trivial…
In my routes.rb, how do I tell: "If no other route matches request, then deliver /foo/bar/request"?
(Note: request ≠ '/')
To be more specific:
If http://example.com/somedir/test/1/2/3 is not matched, try /for/bar/somedir/test/1/2/3, just if that does not exist, deliver *APP_DIR/public/404.html*.
Upvotes: 2
Views: 98
Reputation: 5773
Try this:
match "/home/*request" => redirect{|params| "/foo/bar/#{params[:request]}"}
http://guides.rubyonrails.org/routing.html#route-globbing
Upvotes: 1