找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 6421|回复: 1

老大这个是什么意思怎么操作 。。。。。??

[复制链接]
发表于 2015-3-14 16:11:01 | 显示全部楼层 |阅读模式
7、应用域名301重定向的情况
301重定向可以用fsockopen函数进行测试:用下面的代码
  • <?php
  • $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$fp = fsockopen("www.example.com", 80, $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$errno, $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$errstr, 30);
  • if (!$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$fp) {
  •     echo "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$errstr ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$errno)
  • \n";
  • } else {
  •     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$out = "GET / HTTP/1.1\r\n";
  •     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$out .= "Host: www.example.com\r\n";
  •     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$out .= "Connection: Close\r\n\r\n";
  •     fwrite($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$fp, $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$out);
  •     while (!feof($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$fp)) {
  •         echo fgets($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$fp, 128);
  •     }
  •     fclose($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$fp);
  • }
  • ?>

复制代码
将对应的域名更改为 UCenter 应用中的域名,然后访问此测试脚本,返回的内容有 301 permanently 内容,通信也会失败。
您只要取消重定向即可,一般是 301 跳转规则有问题。

回复

使用道具 举报

发表于 2015-3-15 11:52:55 | 显示全部楼层
看不不明白
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Discuz代码分析|Discuz目录结构|DZ起点网 ( 蜀ICP备13000518号-15 )

GMT+8, 2024-12-23 21:59 , Processed in 0.048283 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表