【发布时间】:2016-07-25 09:26:07
【问题描述】:
我创建了两个网站(http://localhost/webone、http://localhost/webtwo)。
Web 2 有这样的 URL:http://localhost/webtwo/webone(使用 ProxyPass 和 ProxyPassReverse)
如果我们转到上面的 URL,那会显示 web one 的内容。
现在如果有人访问网络,那么我想捕获用户访问 URL。(可能是 http://localhost/webone 或 http://localhost/webtwo/webone)
我的问题是:
如果有人从http://localhost/webtwo/webone URL 访问网络二。然后,如果我执行以下代码,它将返回http://localhost/webone。
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
但浏览器显示 URL 是 http://localhost/webtwo/webone。有人可以建议一种方法来捕获http://localhost/webtwo/webone URL。
【问题讨论】:
-
你使用session来存储路径吗?
-
试试
$_SERVER[SCRIPT_NAME] -
@JeffPuckettII 不工作
-
您是否使用任何可能干扰
REQUEST_URI值的框架?你使用的是我假设的 Apache 网络服务器? -
@chrki 我不使用任何框架,是的,我使用的是 Apache Web 服务器 (xampp)