Our PHP installation is intercepting 404 Page Not Found errors and displaying this basic and generic 404 error message on pages with the .php
extension:
File not found.
It is preventing the requestor from seeing our nicely formatted ERROR 404 Page.
How do I shut off the PHP setting to have the server use our Apache directives for 404’s?
Here is a screenshot of the nicely formatted 404.
Here is a screenshot of the 404 that does not the follow Apache Directives.
3
Answers
I would start looking at the apache conf files (all the conf files in the apache folder i.e. in /etc/apache2 as example, or all the vhost files configuration that should be in something like /etc/apache2/sites-enabled or similar)
if nothing is helping there then
I would start from having a look at the .htaccess files
as I remember there is nothing in the php configuration that is telling to intercept the 404
Check your
.htaccess
file. Check if customErrorDocument
is set. For example:In addition check if there any redirects matching pages having
.php
extension. For example:Due to enabling the mod_proxy_fcgi and using PHP-FPM this might happen.The default error page in the proxy is
File not Found
. Try adding the following in your http.conf or apache.conf