While reading through countless answers on here I can’t seem to find one that works. The task is pretty simple: remove /fldr/subfldr/ from the REQUEST_URI while still always redirecting to index.php. fldr and subfldr are real directories while everything after does not really exist. The .htaccess and index.php are sitting within subfldr.
The current .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [PT,L]
And other RewriteRules I’ve tried:
RewriteRule ^(.*) index.php/$1 [PT,L]
RewriteRule ^/fldr/subfldr/?.*$ index.php [PT,L]
I’ve even tried just adding the folders to the RewriteBase. Every version passes the exact same thing through to the request.
Instead of trying to rewrite the REQUEST_URI environment variable, try just passing a ‘uri’ param or something to the script, something like this:
Then you can use $_GET[‘uri’] in index.php.