Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Remove access to system folder
RewriteCond $1 ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
# Remove access to system folder
RewriteCond $1 ^assets/cms/cache.*
RewriteRule ^(.*)$ /index.php/$1 [L]
# Allow access to asset directories
RewriteCond $1 ^application.*
RewriteCond $1 !(assets.*)
RewriteRule ^(.*)$ /index.php/$1 [L]
# Allow access to asset directories
RewriteCond $1 ^themes.*
RewriteCond $1 !(assets.*)
RewriteRule ^(.*)$ /index.php/$1 [L]
# Check if user is accessing a file or folder that already exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php and everything works as normal.
ErrorDocument 404 /index.php
</IfModule>