I'm doing some performance enhancements and came across the recommendation that
.htaccess
httpd.conf
.htaccess
You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server.
.htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(jpg|jpeg|png|gif|ico|swf|bmp)$ - [L,R=404,NC]
.htaccess
/images
ErrorDocument 404 /images/notfound.gif
.htaccess
ErrorDocument images/404 /images/notfound.gif
You can do this in your Virtual host .conf or the global httpd.conf (aka apache2.conf) file. The important point here is that you only do it for your /images/ directory otherwise you will get this notfound.gif in any 404 error.
e.g. for the httpd.conf or Virtualhost
<Location /images>
ErrorDocument 404 /images/notfound.gif
</Location>
You can also use the Directory Directive
<Directory /absolute/path/to/images>
ErrorDocument 404 /images/notfound.gif
</Directory>
If you have only one Website on your Server that you could put it in your httpd.conf but the better solution is the Virtualhost configuration.
ErrorDocument images/404 /images/notfound.gif
is the wrong syntax see: https://httpd.apache.org/docs/2.4/custom-error.html