If you are opening an http resource such as an image, e.g. http://www.asite.com/animage.jpg and animage.jpg does not exist, but the site does an automatic redirect to a "file not found page", how can your PHP script detect this as an "image file not found"?