You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Quinn <br...@az511.com> on 2002/04/23 19:34:44 UTC

Image Replacement

Sorry if this is not something that Apache can do.  If it's not, please 
just reply off the list.



I have a set of static HTML pages. Each page calls an Image file on the 
machine that is updated automatically every few minutes. The problem is, 
sometimes the image isn't available so a file with the image name is 
created with a files size of 0kb. When someone clicks on the page they get 
that little box that show's a broken image. Is there a way with either an 
Apache config change, SSI, PHP comand, HTML, or something that if that 
image is 0 it would display another image (like a static Image i create 
saying to check back again shortly or something) ?  I only want it to 
effect 1 directory of
html pages though, the rest can stay as they are.


Thanks

Brian


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Image Replacement

Posted by Owen Boyle <ob...@bourse.ch>.
Brian Quinn wrote:
> 
> Sorry if this is not something that Apache can do.  If it's not, please
> just reply off the list.
> 
> I have a set of static HTML pages. Each page calls an Image file on the
> machine that is updated automatically every few minutes. The problem is,
> sometimes the image isn't available so a file with the image name is
> created with a files size of 0kb. When someone clicks on the page they get
> that little box that show's a broken image. Is there a way with either an
> Apache config change, SSI, PHP comand, HTML, or something that if that
> image is 0 it would display another image (like a static Image i create
> saying to check back again shortly or something) ?  I only want it to
> effect 1 directory of
> html pages though, the rest can stay as they are.

If the image has a predictable name then you might be able to arrange
something with a conditional rewrite rule, e.g.

RewriteCond  -s /path/to/banana.png
RewriteRule  /banana.png         /no_image_available.png

I've never tried this, but from the mod_rewrite docs (hint, hint) it
looks like it should work...

Rgds,

Owen Boyle

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org