<FilesMatch "\.(php)$">
    Require all granted
</FilesMatch>

# Deny direct HTTP access to anything that isn't meant to be public.
<FilesMatch "^(config\.php|database\.php|env\.php|bootstrap\.php)$">
    Require all denied
</FilesMatch>

# The old public installer must never be reachable, even if a stale copy is re-uploaded.
<FilesMatch "^setup\.php$">
    Require all denied
</FilesMatch>

<FilesMatch "\.(env|sql|log|lock|txt)$">
    Require all denied
</FilesMatch>

<IfModule mod_rewrite.c>
    RewriteEngine On

    # No public landing page lives at the site root — send visitors
    # straight to the admin area (which itself sends a logged-in admin
    # on to the dashboard, and everyone else to the login form).
    RewriteRule ^$ /admin/ [R=302,L]
</IfModule>
