thanks for your time. I thought I knew how to do this but I've tried dozens of permutations and I'm failing.
I want to replace missing images with a placeholder image of the appropriate size. The real images are organized into directories by size. Directory names are just numbers such as: 320, 640, 960, 1080.... Each size directory contains an appropriately sized image, all called "toc-placeholder.jpg"
Sample of missing image URL
/img/toc/640/toc-074.jpg
Path to placeholder image
/img/toc/640/toc-placeholder.jpg
## PLACEHOLDER FOR MISSING TOC IMAGES ##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$
## REPLACE ANY MISSING UNDER THE "TOC" DIRECTORY WITH ONE SPECIFIC IMAGE##
RewriteRule ^img/toc/* img/toc/960/toc-placeholder.jpg [L]
## REPLACE MISSING IMG WITH IMAGE FROM THE SAME SIZE DIRECTORY##
##RewriteRule ^img/toc/([0-9]+)/([a-zA-Z0-9_-]+)$ img/toc/$1/toc-placeholder.jpg [L]
The first rule (the active one) works fine. Id like to replace it with the second rule (the one that is commented out) so I can redirect to a placeholder of the appropriate size in each case.
Any help would be greatly appreciated.