views:

11

answers:

1

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
+2  A: 

PATH_INFO is reliable. The only problem I can think of is that you may have issues if you use URL rewriting.

DmitryK
Thanks! I don't do that; this is a plain-vanilla ASP app.
Caveatrob