# Local XAMPP serves the whole project folder (DocumentRoot is htdocs), so
# only public/ may be reached: .env, storage/logs, .git, vendor and the rest
# are refused. In production the web server's document root is public/.

<IfModule mod_rewrite.c>
    Options -Indexes
    RewriteEngine On

    # The project folder itself goes to the application.
    RewriteRule ^$ public/ [R=302,L]

    # Everything outside public/ is forbidden.
    RewriteRule !^public(/|$) - [F,L]
</IfModule>

# Without mod_rewrite nothing outside public/ can be told apart: refuse all.
<IfModule !mod_rewrite.c>
    Require all denied
</IfModule>
