I'm building a site which has an autoload php function to check if a class name exists within a controller. This function is in index.php and is run on every url on the site, which then gets redirected with php as appropriate.
I've added a new subdirectory to my document root called engine. Within this subdirectory there are some separate classes which need to be run without going through the autoload function in main index.php within document root.
I'm looking for a .htaccess rule which will allow me to exclude the engine subdirectory and all files/folders within this from the default rewrite rules, which load index.php.
Below is a sample of my .htaccess file, showing 3 different exclusion rules that I have tried.
Rule 2 and rule 3 have had no affect whatsoever. Rule 1 redirects all requests for anything within the engine subdirectory to the index.php in that subdirectory. It seems to lose the rest of the request uri when using rule 1.
For example if I wanted to load engine/subfolder/lib/file.php rule one would just send me to engine/index.php. I think I may be missing something small within that rule which needs to append the rest of the request uri.
Options +FollowSymLinks
RewriteEngine on
#rule 1
RewriteCond %{REQUEST_URI} !^/engine
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ engine [L,QSA]
#rule 2
RewriteRule ^(engine)($|/) - [L]
#rule 3
RewriteRule ^(engine).* - [NC,L]
RewriteRule ^([^/\.]+).html$ index.php?controller=contents&method=viewGeneric&view=generic&link=$1 [L]
RewriteRule ^(/)?$ index.php?controller=contents&method=viewHome&view=home [L,QSA] # Default load
TL;DR so my question is: how do I exclude a directory from the rest of my htaccess rules