I am building a LAMP application www.testing.com and I have an image url www.testing.com/image/folderA/a.jpg.
I want to have a rewrite rule in .htacess such that if user navigates to images that do not exist in /image/foldera, he will be redirected to another image with the url www.testing.com/image/folderB/b.jpg.
This is my code.
RewriteRule ^image/folderA/(.*\.(jpg|gif|png))$ http://%{SERVER_NAME}/image/folderB/b.jpg [R=404,L]
However, this is not working as www.testing.com/image/folderA/a.jpg, which is supposed to return an image, gives an 404. Any idea why?