I am running PHP-FPM on WHM v72.05 with up to date software. I have a custom error page and I am having issues with the Apache ErrorDocument directive. I have the following in my .htaccess file
I am expecting the user to be directed to my error.php whenever the web page can't be found. If I access the following pages (which do not exist), Apache correctly redirects the user to the error.php page
/a_page_which_does_not_exist
/a_page_which_does_not_exist.html
/a_page_which_does_not_exist.abc
However, when I try to access a file with a .php extension that does not exist I get a blank page with the text "File not found. " I am expecting the user to be directed to error.php. I have tried the following:
and
but I still get the File not found text.
My error page has to be a php file raher than a shtml file because it has specific server-side functionality. This used to work perfectly and I can only think that the change to PHP-FPM somehow changed this behaviour.
Can anyone help?
Code:
RewriteEngine On
ErrorDocument 404 /error.php
/a_page_which_does_not_exist
/a_page_which_does_not_exist.html
/a_page_which_does_not_exist.abc
However, when I try to access a file with a .php extension that does not exist I get a blank page with the text "File not found. " I am expecting the user to be directed to error.php. I have tried the following:
Code:
RewriteEngine On
ErrorDocument 404 /[Full Path To User]/error.php
Code:
RewriteEngine On
ErrorDocument 404 "some text"
My error page has to be a php file raher than a shtml file because it has specific server-side functionality. This used to work perfectly and I can only think that the change to PHP-FPM somehow changed this behaviour.
Can anyone help?