ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

404 on non-existing images

February 15, 2011 11:35am

Subscribe [2]
  • #1 / Feb 15, 2011 11:35am

    dominickelly

    179 posts

    If I request a non-existant image on my site:

    http://www.example.com/text.png

    EE returns a 200 OK status code.

    Is there anyway to return a 404 response?

  • #2 / Feb 15, 2011 12:30pm

    Neil Evans

    1403 posts

    this is more an issue with how you have your .htaccess setup for URL rewriting.

  • #3 / Feb 15, 2011 12:35pm

    dominickelly

    179 posts

    I have added:

    <FilesMatch "(\.jpe?g|gif|png|bmp|css|js|flv)$">
      ErrorDocument 404 /404/index
    </FilesMatch>

    To my .htaccess, and still get a 200?

  • #4 / Feb 15, 2011 12:48pm

    dominickelly

    179 posts

    Solved. Added:

    <?
        header( "HTTP/1.1 404 Not Found" );
        exit;
    ?>

    To my 404 page.

  • #5 / Feb 15, 2011 2:21pm

    Ingmar

    29245 posts

    Very glad to see that worked. Please don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases