Squid redirector/URL rewrite based on MIME type
I was just wondering if anyone knew of a way to rewrite a URL in Squid based on the MIME type recieved?
As a bit more info, I am trying to set up a download server. It's job will be to intercept files which should be downloaded to disk, basicaly those which your browser would pop up a save dialogue for, and download them in the background on the server, redirecting the user to a status page. Well, something like that, I have a concept in my head but not a full plan yet. I also plan to add additional download sources, eg BitTorrent and alternative URLs, as well as cache the result for use later.
I could do this based on the file extension in the request, but this would not always work. Can Squid do this? Or maybe Apache? I am not that fussed which proxy I use for it, and I run Apache anyway.
Thanks in advance,