V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
lingchenzi
V2EX  ›  问与答

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

  •  
  •   lingchenzi · 2015-01-06 12:02:35 +08:00 · 2472 次点击
    这是一个创建于 3410 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    6 条回复    2015-01-06 13:01:15 +08:00
    Biwood
        1
    Biwood  
       2015-01-06 12:12:18 +08:00
    我不知道,但是我会去官网搜:

    http://php.net/manual/en/function.http-redirect.php
    mahone3297
        2
    mahone3297  
       2015-01-06 12:15:54 +08:00
    header
    yinxingren
        3
    yinxingren  
       2015-01-06 12:18:08 +08:00 via Android
    Header()输出头
    yinxingren
        4
    yinxingren  
       2015-01-06 12:21:42 +08:00 via Android
    Slienc7
        5
    Slienc7  
       2015-01-06 12:51:19 +08:00
    zhs227
        6
    zhs227  
       2015-01-06 13:01:15 +08:00
    // 301 Moved Permanently
    header("Location: /foo.php",TRUE,301);
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   6161 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 03:00 · PVG 11:00 · LAX 20:00 · JFK 23:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.