# ==============================================================================
# CodeIgniter 3 Subfolder & Main Domain Production .htaccess for cPanel
# ==============================================================================

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Remove index.php from URLs (Works in root or subfolder like /ttravel/)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

# Security: Disable Directory Browsing
Options -Indexes

# Security: Hide Sensitive Files
<IfModule mod_authz_core.c>
    <FilesMatch "^\.">
        Require all denied
    </FilesMatch>
</IfModule>

# Enable Gzip Compression for Faster Loading
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json image/svg+xml
</IfModule>
