[eluser]CroNiX[/eluser]
You could replace all of that, with just this:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
The system and application directories are already protected in CI 2+, so you are duplicating it and it's unnecessary. (see the included htaccess in /system and /application which deny direct access)
You don't need to explicitly exclude directories/files like:
Code:
RewriteCond $1 !^(index\.php|assets|images|css|js|robots\.txt|favicon\.ico)
when you have the lines
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Again, you're duplicating your efforts. The last 2 lines (-f/-d) covers anything you could possible put in that exclude statement. You should use one or the other, but not both. The second method is much better than the first as it covers all real files/directories outside of /system and /application, so if you add some other image dir or something later you don't have to update your htaccess with it.