I want mod_rewrite to redirect all requests to non-existent files and folders and all requests to the main folder ("root") to a subfolder. So I installed it like this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC,OR]
RewriteCond %{REQUEST_URI} / [NC]
RewriteRule ^(.*)$ /my/subfolder/$1 [L,QSA]
Unfortunately, this will not work: if I request example.com/public/, it redirects the script to my processing (therefore redirecting to my / subfolder / index.php? App = public), although there is a “public” folder, Please note that the request domain.com/ correctly redirects to my / subfolder / index.php
Why is this?
source
share