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

后端 未结 7 1918
孤街浪徒
孤街浪徒 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:48

    You could try specifying an HTTP response code using an optional parameter:

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

提交回复
热议问题