`
wangduowu
  • 浏览: 132340 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

php页面跳转

    博客分类:
  • php
阅读更多

PHP的HEADER函数。PHP里的HEADER函数的作用就是向浏览器发出由HTTP协议规定的本来应该通过WEB服务器的控制指令,例如声明返回信 息的类型("Context-type: xxx/xxx"),页面的属性("No cache", "Expire")等等

 

 

1. php的header

 

Header("Location: http://www.dreamdu.com/xhtml/");
Location:后面要有空格

 

2. JavaScript的window.location

 

echo "<script>window.location=\"http://www.dreamdu.com/xhtml/\";</script>"; 

 

 

3. HTML的meta的refresh

 

echo "<meta http-equiv=\"refresh\" content=\"0; url=http://www.dreamdu.com/\" />";

 

 

4.如果是永久性的重定向,考虑到seo可以使用下面代码

 

Header("HTTP/1.1 301 Moved Permanently");
Header("Location: http://www.dreamdu.com/xhtml/");

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics