I need to redirect all requests for an image called my_image.gif, when it’s requested from any subdirectory of /images/, to /other_dir/my_image.gif. So /images/foo/my_image.gif, /images/bar/my_image.gif etc would all go to /other_dir/my_image.gif but all other images in /images/ (and its subdirectories) would be unaffected.
I don’t know if this makes a difference, but my_image.gif will never actually exist in /images/ or any of its subdirectories.
Is there an easy way to do this with .htaccess? I can only seem to find ways to redirect all missing images.
Using mod_rewrite you should add this to your .htaccess, for more info check out the manual