lingchenzi
V2EX  ›  问与答

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

  •  
  •   lingchenzi · Jan 6, 2015 · 2955 views
    This topic created in 4234 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
        1
    Biwood  
       Jan 6, 2015
    我不知道,但是我会去官网搜:

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