PHP header( “Location: /404.php”, true, 404 ) does not work

后端 未结 5 1894
庸人自扰
庸人自扰 2021-01-04 09:04

I\'d like to use the following to redirect pages that are no longer present in the database to the custom 404 page:

ob_start();
....
if ( !$found ):
  header         


        
5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-04 09:37

    I've tried and make sure to check error_log file that is correct way is send 404 headers and then include error page to next line.

    
    

    Finally you have to use exit() for text based browsers.

提交回复
热议问题