lingchenzi
V2EX  ›  问与答

PHP 怎么实现单个页面的 301 跳转?

  •  
  •   lingchenzi · Jan 6, 2015 · 3065 views
    This topic created in 4325 days ago, the information mentioned may be changed or developed.

    比如有个页面的URL是www.xx.com/a,但是这个页面将放弃,想跳转至www.xx.com/b,怎么用PHP实现301跳转?

    我在网上没搜索到教程,只要来这里问问高手们。

    6 replies  •  2015-01-06 13:01:15 +08:00
    Biwood
    Biwood
    Jan 6, 2015
    1
    我不知道,但是我会去官网搜:

    http://php.net/manual/en/function.http-redirect.php
    mahone3297
    mahone3297
    Jan 6, 2015
    2
    header
    yinxingren
    yinxingren
    Jan 6, 2015 via Android
    3
    Header()输出头
    Slienc7
    Slienc7
    Jan 6, 2015
    5
    zhs227
    zhs227
    Jan 6, 2015
    6
    // 301 Moved Permanently
    header("Location: /foo.php",TRUE,301);
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1117 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:08 · PVG 02:08 · LAX 10:08 · JFK 13:08
    ♥ Do have faith in what you're doing.