<IfModule mod_rewrite.c>
    RewriteEngine On

    # Pass Authorization Header in cPanel FastCGI
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Prevent direct access to .env and src
    RewriteRule ^(\.env|src|composer\..*) - [F,L,NC]

    # Rewrite requests directly to public/
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L,QSA]
</IfModule>
