# Protect configuration file
<Files "config.php">
    Require all denied
</Files>

# Protect configuration example file
<Files "config.example.php">
    Require all denied
</Files>

# Enable PHP error logging (disable display in production)
php_flag display_errors Off
php_flag log_errors On

# Set default index file
DirectoryIndex index.php

# Prevent directory listing
Options -Indexes

# Enable GZIP compression
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>

# Set cache control for images
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/webp "access plus 1 month"
</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>
