Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
using a .jpg as ErrorDocument in Apache2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Sun Nov 20, 2005 4:20 pm    Post subject: using a .jpg as ErrorDocument in Apache2 Reply with quote

Hi,

is there some way to display a JPG as ErrorDocument? I have directories with lots of images and instead of a 404 HTML page I want to return a dummy.jpg when a client tries to access a non existant image.

Thank you,
M
Back to top
View user's profile Send private message
Da Fox
Guru
Guru


Joined: 06 Jul 2005
Posts: 342

PostPosted: Sun Nov 20, 2005 4:36 pm    Post subject: Reply with quote

Why not simply imbed the jpg in a HTML document?

Quote:
<html>
<body>
<img src=img.jpg></img>
</body>
</html>


--edit:
If you want to rotate images randomly there are a bunch of options, either look into PHP (should be able to be set as errorpage) or make a crontab/script that symlinks dummy.jpg to some random image every minute or so.
_________________
"Man fears the darkness, and so he scrapes away at the edges of it with fire."
- Rei Ayanami

JGBE, a Java based GameBoy Emulator
Back to top
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Sun Nov 20, 2005 4:46 pm    Post subject: Reply with quote

Da Fox wrote:
Why not simply imbed the jpg in a HTML document?

Thank you for your proposal. But that won't work. The images are already embedded into HTML files. And when an image is missing, the dummy.jpg should be embedded into the HTML file. Think of an online shop with hundreds of DVDs but not all covers are already on the harddisk. Missing covers should then simply be a "will follow soon" jpeg or something like that.

Of course I could solve the problem within PHP or sth. like that, but I can't modify the creating program / template so I would like to solve the problem with apache or the underlying GNU utils / fs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum