php 301 redirects actually doing a 302 redirect

后端 未结 4 1028
独厮守ぢ
独厮守ぢ 2021-01-26 17:37

I have been googling for this but no one appears to have the answer.

This post describes the problem well:

http://www.mail-archive.com/php-general@lists.php.net/

4条回答
  •  遥遥无期
    2021-01-26 18:25

    It should be as given by R. Bemrose; that's the usual example code. I guess there is something not-quite-right about your PHP execution environment.

    Another method you can try is the CGI standard way of passing back a status line:

    header('Status: 301 Moved permanently');
    header('Location: http://www.example.com/');
    

提交回复
热议问题