some times my site server is in too many connection status and mysql show error: (could not connect: too many connection
), but question is how we must set a google friendly or in general a bot friendly HTTP header error for such a this situation in PHP? my means is set a error to tell them my site is temporary down! come back latter!
I hope you have wrapped you code by some exception handler or error handler and you have a global exception handler for your application.
What you can do here is, in the error handler, you can throw an exception which will have some message you want to display. This can be caught by the global application exception handler which will redirect the user to some custom page which you want to show.
Send a 500 Internal Server Error
:
header('HTTP/1.0 500 Internal Server Error');