I would like to redirect all non-files, non-directories to index.php, so everything that exists is directly accessible – except for one directory (which should also go to index.php)
What I have is:
# Files
RewriteCond %{REQUEST_FILENAME} !-f
# Directories except /orderfiles/*
RewriteCond %{REQUEST_FILENAME} ^/(orderfiles/)* [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
This works for directories inside /orderfiles, but a files inside of /orderfiles still goes to that file. I tried adding
RewriteCond %{REQUEST_FILENAME} ^/(orderfiles/)* [OR]
RewriteCond %{REQUEST_FILENAME} !-f
But this breaks and sends every file to index.php.
You’re close, you want something like this:
Then what you have is correct, but you need to change this line:
to: