# Used only when the whole project is uploaded INTO public_html (document root cannot be pointed at /public).
# Every request is served from /public; application folders are never reachable over HTTP.
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^(app|bootstrap|config|database|resources|routes|storage|tests|vendor|docs|scripts|node_modules)(/.*)?$ - [F,L]
    RewriteRule ^(\.env.*|composer\.(json|lock)|package(-lock)?\.json|artisan|phpunit\.xml|vite\.config\.js|\.git.*)$ - [F,L]

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

<FilesMatch "^\.">
    Require all denied
</FilesMatch>
