<IfModule mod_rewrite.c>
    Options -Indexes
    RewriteEngine On

    # Block access to hidden/sensitive files (.env, .git, etc.)
    <FilesMatch "^\.">
        <IfModule mod_authz_core.c>
            Require all denied
        </IfModule>
        <IfModule !mod_authz_core.c>
            Order allow,deny
            Deny from all
        </IfModule>
    </FilesMatch>

    # Forward all traffic to the public folder
    RewriteCond %{REQUEST_URI} !public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
