无法重定向所有不在indexigniter中的index.php,resources或robots.txt的请求

I've changed the directory structure of basic Codeigniter. Now I'm trying to redirect all requests that are not to index.php, resources or robots.txt but my .htaccess is not working. Here is my directory structure

  • project
    • application
    • public
      • .htaccess
      • index.php
    • system

My .htaccess is

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

Try this..

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

If it doesnt work,

Check whether rewrite module is not enabled or not