grexx
asked on
404 error for image: can I display an error image?
Is there a way to let apache serve a custom error image when an image is requested that does not exist on the server?
ASKER
It's a nice option, but it's especially meant for cases where I cannot control the html. So it has to be set on the server side.
Hi,
You might want to check the following URL:
http://www.plinko.net/404/howto.asp?article=11
Basically, create a file called .htaccess in the root directory of the server (the one you refer to as '/') and
have the following line in .htaccess:
-------
ErrorDocument 404 /errors/custom404.html
---------
Then edit your own custom404.html page.
Regards,
Wesly
You might want to check the following URL:
http://www.plinko.net/404/howto.asp?article=11
Basically, create a file called .htaccess in the root directory of the server (the one you refer to as '/') and
have the following line in .htaccess:
-------
ErrorDocument 404 /errors/custom404.html
---------
Then edit your own custom404.html page.
Regards,
Wesly
ASKER
Well, that's for *pages*. I need the same thing but then for *images*. In a page you refer to an image, but that specific image doesn't have to be available. In that case, I want to be able to display a standard error-image.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
By the way, error code 404 means the page in the URL is not found. This URL can be an HTML, CGI, or image.
Wesly
Wesly
<img src="animage.jpg" onerror="this.src='error_i
If the first image cannot be loaded the later will be loaded in its place.