1. RewriteEngine On
2. RewriteCond %{REQUEST_FILENAME} -s [OR]
3. RewriteCond %{REQUEST_FILENAME} -l [OR]
4. RewriteCond %{REQUEST_FILENAME} -d
5. RewriteRule ^.*$ - [L]
6. RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
7. RewriteRule ^(.*) - [E=BASE:%1]
8. RewriteRule ^(.*)$ %{ENV:BASE}/index.php [L]