Cgi.logicalScriptName

string logicalScriptName() const

You can override this if your site base url isn't the same as the script name