摘要:一、用HTTP头信息[size=3]<?php header("Location:[url]http://php.itcast.cn/[/url]");[/size]上面是302跳转,从seo角度,更喜欢下面的这种301跳转[size=3]<?php header("HTTP/1.1 301 Moved Permanently
一、用HTTP头信息

[size=3]<?php
header("Location:[url]http://php.itcast.cn/[/url]");[/size]上面是302跳转,从seo角度,更喜欢下面的这种301跳转

[size=3]<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location:[url]http://php.itcast.cn/[/url]");[/size]二、用HTML标记
用HTML标记,就是用META的REFRESH标记,举例如下:

[size=3]<?php if (!isset($url)) exit;?> <html> <head> <meta http-equiv="content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="refresh" content="0; url=<?php echo $url;?>> </head> <body> </body> </html>[/size]
三、用JAVASCRIPT脚本来实现

[size=3]<?php $url="http://php.itcast.cn"; echo "<script LANGUAGE=’Javascript’>; echo "window.location.href='$url'"; echo "</script>"; ?>[/size]