Before you tell me to go to CodeIgniter multi-application .htaccess problem, hear me out.
The reason I say that is because my problem seems to be nearly the exact same as this posters. My directory structure is:
application/
admin/
app/
..
.htaccess
admin.php
index.php
The htaccess rules are:
RewriteEngine On
RewriteBase /dev/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin$ admin\.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin\/(.*)$ admin\.php/$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index\.php/$1 [L,QSA]
Essentially what I need is:
type in example.com/admin - the url keeps the admin folder, and redirect the user to admin.php
type in example.com/admin/controller/method - same as above
type in example.com/anything_else - the user gets directed to the app instead of admin (index.php)
In testing the person in the aforementioned post's htaccess, which mine are essentially copied from, in an online tester, the two rules involving URIs with 'admin' in it are not passed for some reason. I can only get admin (not ^admin$) to work as a pattern (according to the tester).