Return another image for a 404 not found image.

Discussion in 'Apache' started by TechDesigner, Sep 14, 2011.

  1. #1
    Hi,

    I happned to move lot of images to new folder structures and deleted a few which I thought were no longer useful. Upon checking my error logs I found that many sites had hotlinked these images and are now causing file not found errors.

    Can I return a "default image" to all these not found images via htaccess?

    Thanx.
     
    TechDesigner, Sep 14, 2011 IP
  2. inky2k

    inky2k Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello,

    yup, just make a 301 redirect (moved permanently)

    just add this for every image in .htaccess

    redirect 301 /path_to_image _http://yoursite/path_to_image_you_want_to_redirect_to (remove _ before http)

    hope that help you.
     
    inky2k, Sep 17, 2011 IP