Results 1 to 2 of 2
  1. #1

    404 image request showing my on image.

    My image hosting site is currently receiving 300000 404 hits/month from hotlinked images that have been deleted.

    Is there a way to show my own image on every 404 request?

    Thanks,
    Ossi

  2. #2
    Join Date
    Jul 2005
    Location
    Ann Arbor, MI
    Posts
    271
    You can make a custom 404 error page and point people to it within an .htaccess file like so:

    ErrorDocument 404 /path/to/your/script.php

    Then, in 'script.php', you could do a check to see if they requested an image, and if so, simply redirect the request to an image of your choice. If they didn't request an image (i.e. a regular 404 error), redirect them to a suitable text-based 404 page.
    Blazing Fast Hosting From A2 Hosting - Design Your Perfect VPS Hosting Package
    -Pay Only For The Resources You Need - High-Performance SwiftServers - SSDs With Page Loads Up To 300% Faster Than Standard Hosting! - 99.9% Uptime Guarantee - A2 QuickInstaller - Choose Your Linux OS - Instant Activation - Risk-Free Money Back Guarantee - Choose Your Hosting Location

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •