今天在开发的过程中,发现了这样一个问题
$_SERVER["REQUEST_URI"] 不仅获取了文件路径,还获取了完整的网址。
例如:http://www.xxx.com/test/furniture/
正常的是 /test/furniture/
但是返回的却是 http://www.xxx.com/test/furniture/ 完整的一个网址,
查询PHP手册发现
Keep in mind that if the user is using proxy server (like PAC), REQUEST_URI will include the full request URL likehttp://example.com/path/
当使用代理的时候 URL就会完整返回。