# 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/. 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] # Without mod_rewrite nothing outside public/ can be told apart: refuse all. Require all denied