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

后端 未结 5 1921
庸人自扰
庸人自扰 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:44

    You can't have an header 404 with a Location:

    You should display the error page and set a meta refresh with the new url if you want to redirect

提交回复
热议问题