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:

https://support.cpanel.net/hc/en-us/articles/4404901013143-How-to-enable-ProyErrorOverride-in-WHM

By Daniel

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

Leave a comment