$_SERVER的有关问题,小弟我说为什么一直url重写失败,去不掉index.php
程序员文章站
2022-06-16 13:35:06
...
$_SERVER的问题,我说为什么一直url重写失败,去不掉index.php
有的主机url重写后
$_SERVER['PATH_INFO']会消失,
取而代之的是
$_SERVER["ORIG_PATH_INFO"]
从而导致,根据$_SERVER['PATH_INFO']判断来去掉index.php会失效
我只是发现了这个现象,却不明白原理是为什么?
------解决方案--------------------
PATH_INFO is missing but ORIG_PATH_INFO is there with the information PATH_INFO was supposed to have.
So the php code had to be changed to check for $_SERVER['ORIG_PATH_INFO'] when $_SERVER['PATH_INFO'] is absent
见 http://www.binarytides.com/path_info-orig_path_info-apache-and-php/ 最后一段
有的主机url重写后
$_SERVER['PATH_INFO']会消失,
取而代之的是
$_SERVER["ORIG_PATH_INFO"]
从而导致,根据$_SERVER['PATH_INFO']判断来去掉index.php会失效
我只是发现了这个现象,却不明白原理是为什么?
------解决方案--------------------
PATH_INFO is missing but ORIG_PATH_INFO is there with the information PATH_INFO was supposed to have.
So the php code had to be changed to check for $_SERVER['ORIG_PATH_INFO'] when $_SERVER['PATH_INFO'] is absent
见 http://www.binarytides.com/path_info-orig_path_info-apache-and-php/ 最后一段
相关文章
相关视频