<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] # 概念 當客戶端(瀏覽器)向服務器發送一個URL請求后,但是資源并不在當前請求的服務器上,此時服務器會告訴瀏覽器,資源在另外一個URL地址上,此時瀏覽器會重新發送請求到新的資源地址。 # 使用 ## 301 永久跳轉。跳轉URL會緩存到用戶瀏覽器,除非用戶清理瀏覽器緩存,服務器設置無法再影響舊URL的跳轉。 <br> ![](https://box.kancloud.cn/00bb7477c8a8ee07c8590cba081460c4_1067x146.png) <br> ~~~ const http = require('http') http.createServer(function (req, res) { console.log(`requeset come ${req.url}`) if (req.url === '/') { res.writeHead(301, { 'location': '/new' }) res.end() } if (req.url === '/new') { res.writeHead(200, { 'Content-type': 'text/html' }) res.end('<div>content</div>') } }).listen(8888) // 訪問 http://localhost:8888/ 服務器直接打印 // requeset come /new ~~~ <br> ## 302 臨時跳轉。每次請求仍然需要經過服務端指定跳轉地址。 <br> ![](https://box.kancloud.cn/2c18def9e695b93bf159ffa3c4142f18_1049x150.png) <br> ~~~ const http = require('http') http.createServer(function (req, res) { console.log(`requeset come ${req.url}`) // 臨時跳轉 if (req.url === '/') { res.writeHead(302, { 'location': '/new2' }) res.end() } if (req.url === '/new2') { res.writeHead(200, { 'Content-type': 'text/html' }) res.end('<div>content</div>') } }).listen(8888) console.log('server listen on 8888') ~~~ # 參考資料 [http之Redirect](https://blog.csdn.net/grapelove01/article/details/82810360)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看