Options -Indexes

RewriteEngine On

# Protect sensitive files
<FilesMatch "^(\.env|\.env\.php|bootstrap\.php|php\.ini|\.user\.ini)$">
    Require all denied
</FilesMatch>

# Block direct access to private folders
RewriteRule ^app/ - [F,L,NC]
RewriteRule ^config/ - [F,L,NC]
RewriteRule ^storage/ - [F,L,NC]
RewriteRule ^PHPMailer-master/ - [F,L,NC]
RewriteRule ^dompdf-master/ - [F,L,NC]
RewriteRule ^qr-code-main/ - [F,L,NC]

# Forward requests into the public directory
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ public/$1 [L]