# Case 1
# -------------------------------------------------------#
RewriteEngine on
RewriteCond $1 !^(index\.php|images|public|assets|uploads|themes|install|updates|asset|mob|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
# -------------------------------------------------------#

# Case 2
# -------------------------------------------------------#
# RewriteEngine on
# ExpiresActive On
# ExpiresDefault A2592000
# RewriteCond %{SERVER_PORT} 80
# RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# RewriteCond $1 !^(index\.php|images|public|assets|uploads|themes|install|backups|updates|asset|mob|robots\.txt|curl.php)
# RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
# -------------------------------------------------------#

# Case 3
# -------------------------------------------------------#
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{REQUEST_URI} ^system.*
# RewriteRule ^(.*)$ index.php?/$1 [L]
# RewriteCond %{REQUEST_URI} ^application.*
# RewriteRule ^(.*)$ index.php?/$1 [L]
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ index.php?/$1 [L]
# </IfModule>
# -------------------------------------------------------#

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

# Case 4 for SSL Hosting
# -------------------------------------------------------#
# RewriteEngine on
# ExpiresActive On
# ExpiresDefault A2592000
# RewriteCond %{SERVER_PORT} 80
# RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# RewriteCond $1 !^(index\.php|images|public|assets|uploads|themes|install|updates|asset|mob|robots\.txt)
# RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
# -------------------------------------------------------#

<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
 Header set Cache-Control "max-age=604800, public"
</FilesMatch>

## EXPIRES CACHING ##
 <IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType image/jpg "access 1 year"
 ExpiresByType image/jpeg "access 1 year"
 ExpiresByType image/gif "access 1 year"
 ExpiresByType image/png "access 1 year"
 ExpiresByType text/css "access 1 month"
 ExpiresByType application/pdf "access 1 month"
 ExpiresByType text/x-javascript "access 1 month"
 ExpiresByType application/x-shockwave-flash "access 1 month"
 ExpiresByType image/x-icon "access 1 year"
 ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

<ifModule mod_gzip.c>
 mod_gzip_on Yes
 mod_gzip_dechunk Yes
 mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
 mod_gzip_item_include handler ^cgi-script$
 mod_gzip_item_include mime ^text/.*
 mod_gzip_item_include mime ^application/x-javascript.*
 mod_gzip_item_exclude mime ^image/.*
 mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
