1

I'm trying to set up my .htaccess to display "FAIL" if a file/directory cannot be found. For some reason, the code works on directories and sub-directories, but not on actual file names.

I.E. Navigating to "site.com/fakeDirectory/" will output "FAIL", but site.com/fakeFile.php" will output "File not found."

Literally all I'm using for for this is

ErrorDocument 404 "FAIL"

I would assume that a non-existent file would fall under the same 'category' as a non-existent directory.

EDIT:

This problem appears to only be affecting files with the ".php" extension, for some reason.

Charon
  • 95
  • 1
  • 12
  • Think its being handled by CGI at that point... I assume php-fpm? – ficuscr Jul 02 '19 at 19:35
  • Yeah, take a look at [**ProxyErrorOverride**](http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyerroroverride). https://stackoverflow.com/questions/33843786/custom-404-message-when-using-php-fpm-with-apache I was actually trying to remember this directive the other day. Thanks... My fail2ban rules fail with the php-fpm errors. – ficuscr Jul 02 '19 at 19:37

0 Answers0