# Deny directory browsing
Options -Indexes

# Protect config
<FilesMatch "^config\.php$">
    Require all denied
</FilesMatch>

# Protect logs
<FilesMatch "\.(log|txt)$">
    Require all denied
</FilesMatch>

# PHP Settings
<IfModule mod_php7.c>
    php_flag display_errors Off
    php_value upload_max_filesize 10M
    php_value post_max_size 10M
    php_value max_execution_time 300
</IfModule>

# Security Headers
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-XSS-Protection "1; mode=block"
</IfModule>

# Force HTTPS (uncomment in production)
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
