URL 重写后,Location 跳转的疑问

小黑001 发布于 2015/08/22 22:19
阅读 210
收藏 0

【开源中国 APP 全新上线】“动弹” 回归、集成大模型对话、畅读技术报告”

环境描述:
一个公网IP:123.123.123.123
两个网站,均为PHP: http://www.A.com  http://www.B.com
通过使用IIS7的URL重写,将域名分别映射到内网地址:http://localhost:8001   http://localhost:8002
重写规则就是简单的将域名重写为内网地址,保持{REQUEST_URI}
问题描述:
需求:http://www.A.com/p.php 页面需要通过 header("Location: $url"); 跳转到别的网址,其中 $url=http://www.C.com/cgi-bin/v1.0/pay_gate.cgi?cmdno=1
问题:Location之后,网页没有跳转到http://www.C.com/cgi-bin/v1.0/pay_gate.cgi?cmdno=1 而是跳转到http://www.A.com/cgi-bin/v1.0/pay_gate.cgi?cmdno=1
在内网访问http://localhost:8001/p.php 则可以正常跳转http://www.C.com/cgi-bin/v1.0/pay_gate.cgi?cmdno=1
分析:查看http://www.A.com/p.php Header信息,发现如下内容
Response Headers
Content-Length:0
Content-Type:text/html
Date:Sat, 22 Aug 2015 14:14:15 GMT
Keep-Alive:timeout=5, max=69
Location:http://www.A.com/cgi-bin/v1.0/pay_gate.cgi?cmdno=1
Server:Microsoft-IIS/7.5
X-Powered-By:PHP/5.4.17
X-Powered-By:ARR/2.5
X-Powered-By:ASP.NET
求助:请问有经验的同志指点一下,不胜感激~


加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部