获取页面(使用URL重写)的当前URL [英] get current url of the page (used URL Rewrite)

查看:164
本文介绍了获取页面(使用URL重写)的当前URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在传统的ASP应用程序。
我有一些网页使用URL重写。

I am working on classic asp application. I have use URL rewrite on some pages.

如何才能让网页的当前URL在传统的ASP?

How can i get current url of the page in classic asp?

例如:
在IIS http://www.site.com/page.asp ---> URL重写---> http://www.site.com/home/page

Example: http://www.site.com/page.asp ---> url rewrite in IIS ---> http://www.site.com/home/page

所以在这里我想这是网页的当前URL http://www.site.com/home /

so here i want current url of the page which is http://www.site.com/home/page

请帮助我。
谢谢你。

Please help me. Thanks.

推荐答案

您可以尝试输出的所有ServerVariables像这样:

You can try to output all ServerVariables like so:

for each key in Request.Servervariables
  Response.Write key & " = " & Request.Servervariables(key) & "<br>"
next

也许你所寻求的网址已经存在。我们使用重写模块,有一个名为 HTTP_X_ORIGINAL_URL ServerVariable包含重写URL路径,例如/家/页在你的例子。

Maybe the URL you seek is already there. We use the Rewrite module and there is a ServerVariable called HTTP_X_ORIGINAL_URL that contains the rewritten URL path, e.g. "/home/page" in your example.

协议( HTTPS = ON / OFF )和服务器( SERVER_NAME )也可以在ServerVariables找到。

Protocol (HTTPS=ON/OFF) and Server (SERVER_NAME) can also be found in the ServerVariables.

这篇关于获取页面(使用URL重写)的当前URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆