headers for "image not found" image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BKDotCom

    headers for "image not found" image

    I'd like to serve an image-not-found image for images... that aren't
    found..
    I'm already using a custom 404 handler page.. but this question could
    apply to images retrieved from a database or script or whatever...

    Anyhow, is the 1st method OK, or should #2 be used?
    ie, does the client/bot or whatever recognize the 404 on method 1?
    Or, does it think everything is dandy because of the redirect.

    header('HTTP/1.0 404 Not Found');
    header('locatio n: '.$image_url);
    exit;

    or

    header('HTTP/1.0 404 Not Found');
    header('Content-Type: image/whatever');
    readfile($image filepath);
    exit

    is one way more better?

  • John Dunlop

    #2
    Re: headers for "image not found" image

    BKDotCom wrote:
    [color=blue]
    > header('HTTP/1.0 404 Not Found');
    > header('locatio n: '.$image_url);
    > exit;
    >
    > or
    >
    > header('HTTP/1.0 404 Not Found');
    > header('Content-Type: image/whatever');
    > readfile($image filepath);
    > exit
    >
    > is one way more better?[/color]

    #2 is much betterer because #1 doesn't make much sense.

    --
    Jock

    Comment

    Working...