<IfModule mod_rewrite.c>
    RewriteEngine On

    # Disable directory listing
    Options -Indexes

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

# Block access to sensitive files
<FilesMatch "\.(env|log|yaml|yml|json|lock|xml|md)$">
    Require all denied
</FilesMatch>

<FilesMatch "^(artisan|composer\.json|composer\.lock|package\.json|phpunit\.xml)$">
    Require all denied
</FilesMatch>
