use getScriptName instead of getUrl for redirection