# ======================================================================
# SENTRO QR MENÜ - ZIRHLI .HTACCESS DOSYASI (GÜNCEL)
# ======================================================================

<IfModule mod_rewrite.c>
    RewriteEngine On

    # 0. SSL: HTTP ile gireni HTTPS'ye Zorla (SEO Dostu 301 Yönlendirmesi)
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # 1. SEO: Dinamik robots.txt Yönlendirmesi
    RewriteRule ^robots\.txt$ robots.php [L,NC]

    # 2. SEO: Dinamik sitemap.xml Yönlendirmesi 
    RewriteRule ^sitemap\.xml$ sitemap.php [L,NC]
</IfModule>

# ======================================================================
# GÜVENLİK KALKANLARI
# ======================================================================

# 3. Klasör Listelemeyi Kapat 
Options -Indexes

# 4. Hassas Dosyaların İndirilmesini Engelle
<FilesMatch "\.(sql|env|ini|log|bak|sh)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# 5. Tarayıcı Önbellekleme
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
</IfModule>