分享

写回答

发帖

[提问] 求助:godaddy 301重定向

GoDaddy GoDaddy 1991 人阅读 | 3 人回复

发表于 2010-9-19 16:38:30 | 显示全部楼层 |阅读模式

Linux主机
我想用php重定向几个页面指向另一个站的几个页面
假设原来的页面是1.php  

1.php中的内容是
  1. <?

  2. header("HTTP/1.1 301 Moved Permanently");
  3. header("Location: http://***.com/***.html");
  4. exit();
  5. ?>
  6.                
复制代码


但是传上去之后确提示:
  1. Warning: Cannot modify header information - headers already sent by (output started at /home/content/x/i/m/ximenfengluo/html/zf/fx/1.php:2) in /home/content/x/i/m/ximenfengluo/html/zf/fx/1.php on line 3

  2. Warning: Cannot modify header information - headers already sent by (output started at /home/content/x/i/m/ximenfengluo/html/zf/fx/1.php:2) in /home/content/x/i/m/ximenfengluo/html/zf/fx/1.php on line 4

复制代码



求助怎么解决呀?

回答|共 3 个

gypworks526

发表于 2010-9-19 16:57:38 | 显示全部楼层

是可以的。。

或者直接
<?php
header('Location: http://www.*****.com/');
?>


你重新试下看。。

ximenfeng

发表于 2010-9-19 18:35:36 | 显示全部楼层

原帖由 gypworks526 于 2010-9-19 04:57 PM 发表
是可以的。。

或者直接


你重新试下看。。

谢谢斑竹  还是不行      

ximenfeng

发表于 2010-9-19 19:42:07 | 显示全部楼层

  1. <?php
  2. header( "HTTP/1.1 301 Moved Permanently" );
  3. header( "Location: http://s.com" );

  4. exit;

  5. ?>
复制代码
这样可以了
您需要登录后才可以回帖 登录 | 注册

本版积分规则