I have a lot of hotlinked images. Which is fine but some do not exist anymore due to change in URL. Is it possible to display something like imageshack "image not found error" picture only when images are requested and they do not exist?
Right now I have 404 page but I'd still like to keep that.
I can put up a simple jpg/gif picture saying "Not found" and display that only when pictures are not found.
to be honest I don't know where to begin
my path can be anything from /level1/ to /level1/..../blah/oldpicture.jpg and most pictures are rendered by Gallery2 with url_rewrite so they actually go to php.
location / {
try_files $uri $uri /main.php?url=$1;
#rewrite ^/(.+)$ /main.php?url=$1 last;
}
also I use this in php fpm config portion
fastcgi_intercept_errors on; # to support 404s for PHP files not found
I could try to this by coding but that is a second option.
You can change the error page based on the location. For example:
Perhaps add a location block to do a try_files on images and a rewrite from a named location on failure. Something like this (not tested):