如何将Symfony2静态资产重定向到控制器请求?

How can I redirect a static asset in Symfony2 (e.g: JS, CSS or PDF file) to an actual controller action?

I'm trying to redirect this request (this used to represent a static asset which doesn't exist anymore):

http://localsite.dev/bundles/mybundle/misc/attachment.pdf

to this one (local dev site, this request is handled by a controller):

http://localsite.dev/app_dev.php/downloads

or this (live site):

http://livesite.com/downloads

You should be able to just set up a route for it in your routing.yml like any other route,

eg:

my_pdf_route:
    pattern: "/bundles/mybundle/misc/attachment.pdf"
    defaults: { _controller: MyBundle:PdfController:index }