URL重写后获取URL
有人可以告诉我,是否可以找出浏览器上当前显示的 URL?我正在进行 URL 重写,在代码中我想检查当前显示的是哪个 URL。
有办法检查一下吗?
我尝试通过 Request.URL 获取 URL,但我获取的是实际 URL,而不是重写的 URL。
那么有没有办法获取显示的 URL,而不是实际的 URL?
提前致谢。
Can someone please tell me, is it possible to find out which URL is displayed currently on the browser? I am doing a URL rewrite, and in code I want to check which URL is currently displayed.
Is there a way to check this out?
I have tried to get the URL by Request.URL, but I am getting the actual URL not the rewritten URL.
So is there a way to get the displayed URL, instead of the actual URL?
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在服务器端执行此操作的唯一方法是您可以从正在使用的 URL 重写工具访问 URL 重写上下文。否则,下一个合理的方法是使用 javascript 获取
var url = window.location
,然后使用 AJAX 或类似技术将该 URL 发送回服务器,但这成本很高。您使用哪种 URL 重写工具?我们需要更多信息来正确回答这个问题。谢谢。
The only way to do this on the server-side is if you have access to the URL-rewrite context from the URL-rewriting tool you are using. Otherwise, the next reasonable approach would be to use javascript to get the
var url = window.location
, then use AJAX or a similar technique to send that URL back to the server, but this is costly.Which URL-rewriting tool are you using? We need more information to answer this properly. Thanks.