Jump to content

need help displaying imagedeleted.jpg when i delete an image.


turkman

Recommended Posts

This would probably be better handled with some directives in an .htaccess file unless you're using the image file name as a get request, but I doubt that. Or, if you're using lighty, you would need a rewrite entry in your conf file.

No, he's talking about accessing the file directly and displaying an imagedeleted.jpg if it's been deleted.

 

In your image directory, where the actual images are stored, create an .htaccess file and put something like this in it:

 

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$ 
RewriteRule .* path/to/imagedeleted.jpg [L]

 

If you're running your own VPS make sure you enable the mod_rewrite, or it probably is enabled by default anyways. Make sure the path to imagedeleted is in a web accessible folder.

i have htaccess working in other parts of the site but the code posted above does not work, when i click on an invalid link it just says oops this link appears to be broken.  Obviously i have changed the path to image bit.  Anyone any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.