How can I show a custom page when a 500 Internal Server Error occurs?
I created a page called '500.php'.
Then added the following line to my '.htaccess' file to handle the error:
ErrorDocument 500 /500.php
And the following line to test/trigger a 500 error:
e
But the default 500 page shows up - not my custom one.
I tried editing the first line to this (whole URL):
ErrorDocument 500 http://danispringer.com/500.php
But then I get the "Too many redirects" error.
How can I do this?
- See full htaccess file: here
- Related:
Mod Rewrite 500 Error Correction (Doesn't answer - uses rewrite - not ErrorDocument)
Trigger 500 Internal Server Error in PHP and display Apache error page (explains how to trigger - not handle - the error)
Custom error page failed to load after editing htaccess (Doesn't answer - uses rewrite - not ErrorDocument)
Default Error Page PHP 500 errors in Apache (Dupe of above with no answers)
error file .htacess 500 Internal Server Error (Doesn't answer - uses rewrite - not ErrorDocument)
ErrorDocument 500 /500.php
is enough. – Funk Forty Niner