I would like to redirect certain calls for images on a folder to a PHP file. For example, calls that come for:
example.com/news/123-hitachi.jpg
should go to:
example.com/image.php?i=123-hitachi.jpg
or something similar like that. It would also be cool if I would add some more variables in the URI like:
example.com/news/345/hitachi.jpg
so that the .PHP would receive 2 or more parameters.
How can I achieve that?
EDIT:
It should only rewrite SOME pictures, for example that come with a special folder in it like:
example.com/SPECIAL/parameter/id/bogus_filename.jpg
This should work for your “also cool if” case: example.com/news/345/hitachi.jpg
Requests for jpg images in
/newsare rewritten. The parameterireceives the image number. The parameterpreceives the rest of the image filename.