问题
Am I always going to be able to use PATH_INFO to derive the root of my application as in the following function?
function CommonFunctions_getRoot()
pathinfo=Request.ServerVariables("PATH_INFO")
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^(/\w*/).*"
CommonFunctions_getRoot = myRegExp.Replace (pathinfo, "$1")
end function
回答1:
PATH_INFO is reliable. The only problem I can think of is that you may have issues if you use URL rewriting.
来源:https://stackoverflow.com/questions/3508206/reliability-of-path-info-server-variable-in-classic-asp