One thing that could be going on is that there is an Apache ReWrite. That is, when Apache sees a URL that matches a certain pattern like www.mysite.com/xxx/?p=xxxxx then it uses the parts of that URL to construct a new URL like:
www.mysite.com/some_other_directory/myscript.php?p=xxxxx
Of course, you aren't really succeeding in hiding your script because if anyone wants to find it, they can just reference: www.mysite.com/xxx/?p=xxxxx