2

I have a lot galleries displayed with Lightbox2 and it works fine. Now I want to delete the larger version of the pictures, but keep the gallery with the thumbnails for visitors.

How can I manage, that lightbox2 displays an alternative image, if the given file in the html is not existing?

I couldn't find an option in lightbox.js to handle with missing targets.

BeST
  • 21
  • 1

1 Answers1

0

I had the same question, but after a little research I decided that Lightbox2 is not the right place to handle missing images. Instead, that should be handled at the server or application level.

The web server will respond with a 404 error for any missing resource, whether a web page, image, or anything else. In most cases, it also returns a small HTML page to alert the user (such as this example at Google).

You can usually configure your server or application to return a default 404-style image instead of an HTML page if the requested resource was an image. That will then be displayed to the user instead of the broken image symbol.

How you do this of course depends on the particular server/application stack you are using, but here is a good solution for Apache.

Doug
  • 2,400
  • 2
  • 18
  • 24