PHP header 404 not working

后端 未结 4 1240
孤独总比滥情好
孤独总比滥情好 2021-01-13 01:52

Why is this not working, as in the pre-set 404 page is not loaded:

header(\"HTTP/1.0 404 Not Found\");
exit;

.htaccess has the

4条回答
  •  天涯浪人
    2021-01-13 02:08

    This is mostly likely because Apache has already passed the initial request off to a PHP page to handle. Most likely because you have a front controller implementation in effect and are redirecting all web requests to this page. This leaves the responsibility of 404s to your application along with an appropriate 404 page to display.

提交回复
热议问题