Return error 404 for images

0

I need to return error 404 in when an image is not found on the server, but it is returning http code 200.

This problem is happening because the server uses caching varnish and the support made me believe that the error of the images is turned on because it is not returning the 404 status and 200 status.

They said the following:

  

I need fallback images to be delivered with status 404

.

I honestly do not know where to start doing this.

I thought of some rule in htaccess

What do you suggest?

    
asked by anonymous 05.07.2017 / 19:14

1 answer

0

Here's a good rule here

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule \.(gif|jpe?g|png|bmp) /path/to/logo.gif [NC,L]

You can use the documentation of ErrorDocument, so you can point the error to what you want or if you want an error image and it has an extension you can use the MIME :: Types

It's worth looking at esse

Font

    
05.07.2017 / 19:37