# Pinterest Pin Manager - Apache Configuration

# Enable rewrite engine
RewriteEngine On

# Prevent directory browsing
Options -Indexes

# Protect config files
<FilesMatch "^(db\.php)$">
    Order allow,deny
    Deny from all
</FilesMatch>

# Protect SQL files
<FilesMatch "\.(sql)$">
    Order allow,deny
    Deny from all
</FilesMatch>

# Set default charset
AddDefaultCharset UTF-8

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

# Cache static files
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
</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>

# Error pages (optional)
ErrorDocument 404 /admin/index.php
