Closed Thread Icon

Topic awaiting preservation: .htaccess - send default .jpg if requested .jpg isn't found? Pages that link to <a href="https://ozoneasylum.com/backlink?for=27855" title="Pages that link to Topic awaiting preservation: .htaccess - send default .jpg if requested .jpg isn&amp;#039;t found?" rel="nofollow" >Topic awaiting preservation: .htaccess - send default .jpg if requested .jpg isn&#039;t found?\

 
Author Thread
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 04-28-2006 14:45

Greets!

I have a directory with thousands of .jpg files in it. I'm using an AJAX application to grab XML data from the server to display the records.

What I need is an option to display a default .jpg if the request image isn't found on the server.

Normally, I would use PHP to just do a check, but the XML can sometimes be sending out a single page with more than 100 records on it, and I don't want to bog down the server with doing all of the file checks.

Does anyone know how to do this in .htaccess? I tried using an errorDocument declaration, but that doesn't seem to work.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-28-2006 16:32

Guess an ErrorHandler to a php script that then outputs the default jpg (with the appropriate headers) should work?

« BackwardsOnwards »

Show Forum Drop Down Menu