I am trying to forward all requests for other index.php files to the root index.php file with the path encoded as a GET variable. Here are some examples of what I mean:

> 
> <http://my-site.com/this/is/the/path/index.php> would become:
> <http://my-site.com/?path=%2Fthis%2Fis%2Fthe%2Fpath%2Findex.php>
> 
> 
> <http://my-site.com/this/is/the/path/> would become:
> <http://my-site.com/?path=%2Fthis%2Fis%2Fthe%2Fpath%2F>
> 
> 
> <http://my-site.com/this/is/the/path/index.php?v=var> would become:
> <http://my-site.com/?path=%2Fthis%2Fis%2Fthe%2Fpath%2Findex.php%3Fv%3Dvar>
> 
> 
> 

How can this be done with the .htaccess file?

**EDIT**
To be clear, here is what I am hoping to achieve:

* If a path is to a file called "index.php" it redirects as long is it is not the root index file. Note, said index.php file could have GET variables that should be included.
* If a path ends in a slash, in should redirect as well as long is it is not the root. Again, note said path could have GET variables that should be included.
* Otherwise, it should not redirect any other paths.

In summary, only paths to an index.php file (that are not the root) or that end in a slash should be redirected.