我的IIS将http://example.com/wiki/Main (重写前的url)重写为http://example.com/w/index.php?title=Main (重写后的url)。
在index.php中,$_SERVER['REQUEST_URI']
返回wiki/Main
。
我使用的是Windows 2008 Server、IIS 7、PHP 5.4。重写工具是IIS URL重写模块2。我是PHP、IIS和网站的新手。
REQUEST_URI
是在重写之前还是重写之后引用url?
如果REQUEST_URI
是重写前的url,如何获取重写后的url?
发布于 2015-01-03 14:05:23
尝试解析$_GET全局数组:
$URL = $_SERVER['PHP_SELF'] . '?'; // index.php?
for ($_GET as $key => $value)
{
$URL .= $key . '=' . $value . '&';
}
或者类似的东西。基本上,所有URL =
关联都存储在$_GET中。
https://stackoverflow.com/questions/27750401
复制相似问题