Custom 404 redirection instead shows “File not found” for PHP files

Last Updated on 4 November 2022 by Daniel

This commonly is because mod_proxy_fcgi is enabled, and you are using PHP-FPM. The default error page in the proxy is one line:

File not found.

To correct, add the line below to your httpd.conf or apache2.conf file Do NOT add to your .htaccess file.

It forces your .htaccess file’s ErrorDocument directive to override the default Proxy error page. Restart the web server afterwards.

ProxyErrorOverride On

If you use WHM / cPanel, then see the article here:

By Daniel

I'm the founder and CEO of Lionsgate Creative, Password Sentry, and hoodPALS. Besides coding and technology, I also enjoy cycling, photography, and cooking.

Leave a comment