Find files in previous folders with mod_rewrite
1 2 RewriteEngine On 3 RewriteCond %{REQUEST_FILENAME} !-f 4 RewriteCond %{REQUEST_FILENAME} !-d 5 RewriteRule ^[^/]*/(.*) $1
Assuming the file "/test/x.txt" exists, when requesting the url "/test/blabla/folder/xyz/x.txt", it will go up until finding the requested file:
/test/blabla/folder/x.txt
/test/blabla/x.txt
/test/x.txt (found...)