DirectoryIndex public/index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Serve real files/folders that live under public/ directly (css, js, images, uploads)
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    # Everything else (including the domain root "/") goes through the front controller.
    RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>

<IfModule mod_headers.c>
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-Frame-Options "SAMEORIGIN"
</IfModule>

<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>

<FilesMatch "^(\.env|composer\.(json|lock)|README\.md|\.gitignore)">
    Order allow,deny
    Deny from all
</FilesMatch>