I've set up Custom Error Pages through Plesk. Initially this was all working perfectly, however since then we've migrated to a new server, and now they're not working quite right.
If I trigger an error page through .htaccess e.g.
This works perfectly and we see our custom error page. However, if I trigger it from PHP e.g.
Then we just get a standard 405 error, NOT our custom error page. Previously this did work, but at some point in the last few months (possibly when migrating servers) it has stopped.
The site in question is running PHP-FPM 8.2 through Apache on Plesk Obsidian 18.0.62
If I trigger an error page through .htaccess e.g.
Code:
RewriteRule ^foo$ - [R=405,NC,L]
This works perfectly and we see our custom error page. However, if I trigger it from PHP e.g.
Code:
http_response_code(405);
Then we just get a standard 405 error, NOT our custom error page. Previously this did work, but at some point in the last few months (possibly when migrating servers) it has stopped.
The site in question is running PHP-FPM 8.2 through Apache on Plesk Obsidian 18.0.62