Advice on Broken Image Links

Hi all,

Let me try to explain my problem/question.

We have a Zenphoto gallery that when a user on on an Album, we provide them with some embed html that they can use on their own site.

eg
http://spoilertv.co.uk/images/fringe/season-4/promotional-episode-photos/episode-4.01-neither-here-nor-there/

This is great and works well.

However, we recently had to move an album, and this caused an issue with broken image links

see here for example
http://itsawesometv.com/blog/2011/04/07/hawaii-5-0-1-22-hoohuli-naau-poze-promotionale/

You will see that the images are broken and the links take you to a Zenphoto page saying "Object Not Found".

Now what I would like to do is to have some sort of catchall image and link redirect.

eg
So that rather than displaying a broken image on site that has embeded the old code, that they get a little icon. This would stop the 100's of 404 errors in my server log.

Also it would be great if when they clicked on the icon, that rather than go to the Object Not Found page, that it redirects to the Gallery Homepage.

Any suggestions about how I can do this? Links/examples most welcomed.

Comments

  • Each theme has (or can have) its own 404 handling script. All the Zenphoto themes do. So you can make a theme with whatever you want for that 404 handling.

    If you want to prevent the 404 error you will have to add a redirect to your .htaccess to redirect any moved albums/images.
  • Ok, I've managed to get the broken images working by adding this to the htaccess of the cache folder.

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule \.(gif|jpe?g|png)$ http://spoilertv.co.uk/images/albums/misc/bandwidth/missing.png [R=301,L]

    Still not sure how to redirect the link to the gallery homepage
  • The gallery home page is [domain]/zenphoto folder/index.php
  • I really don't know how I would redirect.

    Is this done in the htaccess ? I'm a bit confused.
  • acrylian Administrator, Developer
    So you actually want a 404 image for image directly? The theme pages for 404 are actually for theme pages and not images directly. You would need to do that with htaccess, probably within the main albums folder. This is actually quite the same principle as with the hotline topic. Sorry, I have no proper example at hand.
  • No problem. I think I've got it all sorted now. Appreciate the help.
Sign In or Register to comment.