# =========================================
# CODEIGNITER URL REWRITE ENGINE
# =========================================
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

# =========================================
# HIGH-PERFORMANCE STATIC ASSETS CACHING
# =========================================
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/webp "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(css|js|gif|pdf|jpg|jpeg|png|webp|ico)$">
        Header set Cache-Control "max-age=604800, public, must-revalidate"
    </FilesMatch>
</IfModule>