Hi all,

I've only just started using mod_rewrite (i.e., first time I touched it was about an hour ago), but iv'e hit a problem that Google can't answer

I need mod_rewrite to use a PHP file in a parent directory that is relative to the file the browser is accessing.

An example:

I have a .htaccess file in the directory http://www.domain.com/dir/.htaccess

I have a PHP file in the dir http://www.domain.com/dir/file.php

I have many folders inside "dir" with files inside, e.g.

I need all files in the above subsubdirectories to parse through the PHP file located inside "dir" (this includes directories with or without trailing slashes, where the PHP script will choose to spit out a file called index.html). All .htaccess code needs to be placed inside "dir".

Here is some code I have:
RewriteEngine On
RewriteCond $1 !\.php
RewriteRule ^(.*) file.php?file=$1
This works on any files located at http://www.domain.com/dir/file.ext (i.e. these are 'rewritten' to file.php).

However, the subsubdirectories get strange errors, they include the filepath twice...
[Sat May 21 11:53:26 2005] [error] [client x.x.x.x] File does not exist: /home/lyxituk/dir/one/home/lyxituk/dir/file.php
Any ideas? help? Would be appreciated.