Thanks to this forum, I learnt PHP header function does not actually send header to Apache server but only to the client.
What I wanna do is to generate an error 500, and let Apache displays its corresponding page. Is there a way to force it ?
Thanks in advance ! (and allez les bleus !)
There's a way of sending a 500 Error to the browser, but you'll have to provide the page yourself:
<?php
header('HTTP/1.1 500 Internal Server Error');
echo <<<ERRORTEXT
The server encountered an unexpected condition which prevented it
from fulfilling the request.
ERRORTEXT;
// also notify server operator, maybe?
exit;
?>
Do a redirect to a URL that causes a 500.
For example a url with an invalid .htaccess directive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With