Allow me to explain my situation:

I am utilizing a MVC framework (CodeIgniter), so every request will get rewritten to my index.php file, which routes this to my classes and processes.

Offcours if you will find demands legitimate files they shouldn't be processed by scripts but directly send from webserver to browser.

Owkay not a problem, the next rewrite rules is going to do exactly that:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

I'd like that demands for any certain folder (let refer to it as 'private') be processed by php. The reason behind carrying this out is the fact that i'd then verify when the user is authenticated, and when so, send contents to browser.

  • Any apache gurus in the home who are able to assist?
  • Is a acceptable means to fix this the issue?

Do this rule:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond $1 ^private($|/)
RewriteRule ^(.*)$ index.php/$1 [L]

This can exclude any URL pathways which are private or begin with private/ despite the fact that they're existing folders or files.