PHP header 404 not working
snippet in htaccess

PHP header 404 not working

user3184

header("HTTP/1.0 404 Not Found");
include('./404.html');
exit;

PHP header 404 not working

user5207

<?php
header("HTTP/1.0 404 Not Found");
exit("<h1>Not Found</h1>
The requested URL " . $_SERVER["REQUEST_URI"] . " was not found on this server.
<hr>");
?>