# Control Manager — Apache Security Configuration
# Configured for: https://controlmanager.scoutout.org.uk

# ── Force HTTPS ──────────────────────────────────────────────
# Uncomment these two lines once SSL certificate is active:
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ── Block direct access to sensitive files ───────────────────
<FilesMatch "\.(sql|log|md|txt)$">
    Order allow,deny
    Deny from all
</FilesMatch>

# ── Block direct access to includes/ directory ───────────────
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^includes/ - [F,L]
</IfModule>

# ── Security Headers ─────────────────────────────────────────
<IfModule mod_headers.c>
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-XSS-Protection "1; mode=block"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    Header unset X-Powered-By
</IfModule>

# ── Disable directory listing ────────────────────────────────
Options -Indexes

ServerSignature Off
