I want to redirect the following URL (and many, many more like it on my web app):
http://0.0.0.0:3000/images/q/big_background/1680x1008/quality/83/interlace/true/src/http%3A%2F%2F0.0.0.0%3A3000%2Fmedia%2FW1siZiIsIjIwMTQvMDIvMDYvdjFiZzFleXRkX3NsaWRlc2hvd19maWxsLmpwZyJdXQ%2Fslideshow_fill.jpg
This is the route I am using:
match 'images/(*path)' => redirect { |params, request| "http://0.0.0.0:8080/#{params[:path]}" }
I expect that the above url would be redirected to a new server as (notice that everything after "src" is still url encoded and that there is a .jpg):
http://0.0.0.0:8080/q/big_background/1680x1008/quality/83/interlace/true/src/http%3A%2F%2F0.0.0.0%3A3000%2Fmedia%2FW1siZiIsIjIwMTQvMDIvMDYvdjFiZzFleXRkX3NsaWRlc2hvd19maWxsLmpwZyJdXQ%2Fslideshow_fill.jpg
However, right now it is being sent as (notice that everything after src is no longer encoded and that the .jpg has been truncated):
http://0.0.0.0:8080/q/big_background/1680x1008/quality/83/interlace/true/src/http://0.0.0.0:3000/media/W1siZiIsIjIwMTQvMDIvMDYvdjFiZzFleXRkX3NsaWRlc2hvd19maWxsLmpwZyJdXQ/slideshow_fill
This is happening during the routing. But I have no idea why the routes would decode the url and truncate. A puts of params[:path] shows that is it truncated at that point, so it must be the (*path) but I am not sure how to get the redirect to work properly. Any help would be greatly appreciated!