I have 3 files: index.php,.htaccess,404.shtml
index.php contains:
<?php
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
?>
.htaccess contains:
ErrorDocument 404 /404.shtml
404.shtml contains:
Hello World
when i visit index.php my browser tells me oops something went wrong. What might possibly have gone wrong?
I think because .htaccess comes first and the server would redirect to it only if the physical file really doesn’t exists.
If you handle 404 via php header you should handle it either for real user eg. with
for reference try looking here
Why won't my PHP app send a 404 error?