Options -Indexes

<FilesMatch "^(\.env|composer\.(json|lock)|hash\.php|gitignore)$">
    Require all denied
</FilesMatch>

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Never expose application source or private data.
    RewriteRule ^(?:app|bootstrap|config|database|docs|installer|license|resources|routes|storage|tests|vendor)(?:/|$) - [F,L,NC]

    # Allow cPanel accounts whose document root cannot be changed to /public.
    RewriteRule ^$ public/ [L]
    RewriteRule ^(?!public/)(.*)$ public/$1 [L]
</IfModule>
