H. Ferrence
H. Ferrence

Reputation: 8116

PHP Configuration Setting for 404 Errors

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.

Upvotes: 0

Views: 1033

Answers (3)

Al-Amin
Al-Amin

Reputation: 656

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

ProxyErrorOverride On

Upvotes: 0

user2560539
user2560539

Reputation:

Check your .htaccess file. Check if custom ErrorDocument is set. For example:

ErrorDocument 404 /file-not-found.php

In addition check if there any redirects matching pages having .php extension. For example:

RewriteCond %{THE_REQUEST} \ /+[^\?]+\.php
RewriteRule ^ - [L,R=404]

Upvotes: 1

d3javu999
d3javu999

Reputation: 323

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

Upvotes: 0

Related Questions