Customized Error 500 pages are the hardest to use. The problem is, there are many reasons why a server can throw a 500 internal server error
. Custom pages for 500 only work if the cause of the 500 can be handled by Apache to display the page. Say for instance you made a syntax error in your .htaccess page or in your apache config file, it's going to throw a 500 server error
but because Apache is down
, it can't serve anything including that custom page, so you get the browsers default page. Also depending on how you have your PHP error reporting setting you won't get 500 custom page either. There is a lot more to this and customizing 500 page is almost useless cause most people won't ever see that. You will know before they will because it's a 500 is typically configuration
issue, like a syntax error in your code.
503
is the most common page a user will see especially if your site is down for maintenance and those are the one's I would focus on.
Anyway, I'd take a look at this link to see more info on 500 custom pages on when and why it won't work.
Apache's ErrorDocument directive does not redirect.
Also from Apache docs
Although most error messages can be overridden, there are certain
circumstances where the internal messages are used regardless of the
setting of ErrorDocument. In particular, if a malformed request is
detected, normal request processing will be immediately halted and the
internal error message returned. This is necessary to guard against
security problems caused by bad requests.
http://httpd.apache.org/docs/2.4/mod/core.html#errordocument