简体   繁体   English

获取404 IIS重定向上的页面URL(经典ASP中的自定义错误页面)

[英]Get Page URL on 404 IIS Redirection (Custom Error Page in Classic ASP)

I have implemented IIS Redirection on 404 error code and created a Custom Error Page for it. 我已经在404错误代码上实现了IIS重定向,并为其创建了一个自定义错误页面。 My Custom error page is written in classic asp (eg: FileNotFound.asp). 我的“自定义”错误页面以经典的ASP编写(例如:FileNotFound.asp)。 I need to write the URL of calling page (which does not exists) in my Custom Error Page. 我需要在“自定义错误页面”中编写调用页面的URL(不存在)。

You need the following: 您需要以下内容:

Request.ServerVariables (server_variable) 

Replace it with: 替换为:

Request.ServerVariables (HTTP_REFERER) 

That should work. 那应该工作。 Article on it at w3Schools: http://www.w3schools.com/asp/coll_servervariables.asp 在w3Schools上的相关文章: http : //www.w3schools.com/asp/coll_servervariables.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM