Topic: .htaccess - send default .jpg if requested .jpg isn't found? (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic: .htaccess - send default .jpg if requested .jpg isn&amp;#039;t found? (Page 1 of 1)" rel="nofollow" >Topic: .htaccess - send default .jpg if requested .jpg isn&#039;t found? <span class="small">(Page 1 of 1)</span>\

Paranoid (IV) Inmate

Insane since: Apr 2000

IP logged posted posted 04-28-2006 14:45 Edit Quote


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

IP logged posted posted 04-28-2006 16:32 Edit Quote

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

Post Reply
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
Your Text:
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu