Why .htaccess behaving strangely? Passing the script-name itself instead of given GET varaible
===

I have this setup in my htdocs:

    htdocs
    htdocs/somedir
    htdocs/somedir/process.php
    htdocs/somedir/.htaccess

This is the .htaccess code:

    RewriteEngine on
    RewriteRule ^([^/]*)$ process.php?var=$1 [L]

What I believe is that this rule tells apapche to start from the right-most letter and keep storing it unless it encounters a `/` So, in URL `http://127.0.0.1/somedir/foo`, `$1` should be `foo`. Right?

But when I go to this URL: `http://127.0.0.1/somedir/foo`, a print_r($_GET) in `process.php` outputs this:

    Array
    (
        [var] => process.php
    )

Whereas I expect that it should say this:


    Array
    (
        [var] => foo
    )

So why is `var`'s value is `process.php` and not `foo`? How to write this rewrite rule so that `var` gets the value `foo`?

**Sidenote:** No matter if I move this `process.php` & `.htaccess` to root OR any Second/Third/Fourth level, all the appropirate URLs produce same results:

Like:

    http://127.0.0.1/foo             //process.php & .htaccess in root
    http://127.0.0.1/somedir/foo     //process.php & .htaccess in htdocs/somedir
    http://127.0.0.1/somedir/2nd/foo //process.php & .htaccess in htdocs/somedir/2nd