久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網
      最全最豐富的資訊網站

      php怎么實現301重定向跳轉

      方法:1、用“header('HTTP/1.1 301 Moved Permanently');header('Location:URL地址');”語句跳轉;2、用“header('Location:URL',true,301)”語句跳轉。

      php怎么實現301重定向跳轉

      本教程操作環(huán)境:windows7系統、PHP7.1版,DELL G3電腦

      php實現301重定向跳轉

      網上搜了一圈都是用

      header('HTTP/1.1 301 Moved Permanently');

      再配合

      header('Location: https://www.php.cn');

      完成的。

      總感覺一句話干不完,再加上HTTP/2啥的都出來許久了還寫了個HTTP/1.1看著不太爽,當然寫成HTTP/2或是HTTP/1.0也沒事,但是不管寫什么總之有種表述不清的感覺(比如寫的HTTP/1.1實際訪問時是HTTP/2——訪問的時候該HTTP/2的時候還是HTTP/2也沒問題不會亂變HTTP/1.1

      又去 php.net 尋覓一番,發(fā)現 Header 可以這樣用

      header ( string $header [, bool $replace = TRUE [, int $http_response_code ]] )

      這就好辦了,一句話

      header('Location: https://www.php.cn', true, 301);

      完事,哈哈哈哈哈哈

      額外再提一句,如果要自適應HTTPS/HTTP的話,這樣就可以了:

      header('Location: //www.php.cn', true, 301);

      推薦學習:《PHP視頻教程》

      贊(0)
      分享到: 更多 (0)
      網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號