Options -Indexes
RewriteEngine On

# HTTPS (SSL varsa aktif et)
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Güvenli klasörlere web erişimini engelle
RewriteRule ^includes/db\.config\.php$ - [F,L]
RewriteRule ^includes/config\.php$     - [F,L]
RewriteRule ^uploads/                  - [F,L]

# PHP hata mesajlarını gizle
php_flag  display_errors off
php_value error_reporting 0

# Güvenlik başlıkları
<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"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# Gzip
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json
</IfModule>

# Cache
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css            "access plus 1 week"
  ExpiresByType application/javascript "access plus 1 week"
  ExpiresByType image/png           "access plus 1 month"
</IfModule>
