Any ideas on replacing the Apache HTTP 500 (Internal Server Error) error with HTTP 503 (Service Unavailable) with a PHP error after the PHP error display is turned off? This is a much better way to tell spiders to return to the site soon ...
PS it would be great if it was possible to add Retry-After to the 50x error codes, if possible ...
amuses / Marcin
I assume that you are referring to PHP new (starting with 5.2.4) the default behavior is throwing 500 if an error occurs and no other output is made.
AFAIK, this behavior is hard-coded; you cannot change this without changing PHP itself.
The easiest way is to set up a custom error handler and get 503 for you:
header("HTTP/1.1 503 Service Unavailable"); echo "--- error message here -----"; die();
I wonder if you can do something like Apache
Redirect 503 /error/500 /maintenance.html
on the
ErrorDocument 500 /error/500
directive?
Source: https://habr.com/ru/post/1343841/More articles:How to get focused control in WPF? - controlsHow to record a screen on Windows Phone 7 as a video? - windows-phone-7Resize UIView to match CGPath - iosIs strcpy always dangerous? - cWhen a PHP Fatal error occurs, Nginx reports an HTTP Error 500 to the browser - phpno need to declare "var me = this" for javascript prototype functions - javascriptParsing large XML file over FTP - phppip does not find installation file - pythonXcode 4 Quick Help Not much information about iOS is displayed - iosThe problem of weird casting. The base is received in C ++. - c ++All Articles