urlasp-classicrequest.servervariables

request.serverVariables() "URL" vs "Script_Name"


I am maintaining a classic asp application and while going over the code I came across two similar lines of code:

Request.ServerVariables("URL")
' Output: "/path/to/file.asp"

Request.ServerVariables("SCRIPT_NAME")
' Output: "/path/to/file.asp"

I don't get it... what is the difference? both of them ignore the URL rewriting that I have set up which puts the /path folder as the root document (the above URL is rewritten to "/to/file.asp")

More info: The site is deployed on IIS 7


Solution

  • This could be a bug under IIS 7.

    I could not get Request.ServerVariables("URL") and Request.ServerVariables("SCRIPT_NAME") to return different values. I've tried the cases where they were called from an included file (<!--#include file="file.asp"-->) or after a Server.Transfer.