I'm trying to redirect all non existing images to np-photo.jpg but I need some diversification:
- If requestet file begins with letter "A" it should be redirected to no-photo-A.jpg
- If requestet file begins with letter "B" it should be redirected to no-photo-B.jpg
- ...
I have code:
Options +FollowSymLinks
RewriteEngine ON
RewriteCond %{REQUEST_URI} "/images/"
RewriteCond %{REQUEST_FILENAME} ^a.*\.jpg(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+) /images/no-photo-A.jpg [L,R=301]
problem is with:
RewriteCond %{REQUEST_FILENAME} ^a.*\.(jpeg|jpg|gif|png)$
If I remove letter a then it matches all requests but I cannot force it to match only filenames that begins with specyfic letter.
https://domainname.pl/images/a11.jpg -should be redirected
https://domainname.pl/images/b11.jpg -should not be redirected