I have some php files in the root directory and a directory containing some php files which I want to exclude from codeigniter. I have this code in htaccess file
RewriteCond %{REQUEST_URI} !^subdomain_name\. [NC]
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^/(directory_to_exclude)$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteRule ^(.*)$ index.php/$1 [L]
When I navigate to example.com/directory_to_exclude I get a list of php files (I'll add an index to prevent listing) but when I try to run any of them it reloads the codeigniter homepage. So how to fix this and how to exclude any php file in the root directory like example.com/test.php