Options -Indexes
DirectoryIndex index.php login.php

# Force HTTPS when the host provides HTTPS.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# Security headers (safe baseline for this PHP portal).
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>

# Do not serve documentation/config backups directly.
<FilesMatch "^(README.*|.*\.(bak|backup|old|sql|log|ini))$">
    Require all denied
</FilesMatch>
