header('HTTP/1.0 404 Not Found'); not doing anything

后端 未结 7 1933
孤街浪徒
孤街浪徒 2020-12-09 07:30

I have a 404.php file in my site\'s main directory and I was using header(\'Location: 404.php\'); for a while until someone said that you should use heade

7条回答
  •  一个人的身影
    2020-12-09 07:59

    After writing

    header('HTTP/1.0 404 Not Found');
    

    add one more header for any inexisting page on your site. It works, for sure.

    header("Location: http://yoursite/nowhere");
    die;
    

提交回复
热议问题