# QR Menü - SEO dostu URL yönlendirmesi (kök / alt klasör / subdomain uyumlu)
Options -MultiViews
Options -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Gerçek dosya veya klasör ise dokunma
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Her şeyi ön kontrolcüye yönlendir (RewriteBase gerekmeden, göreli çalışır)
    RewriteRule ^ index.php [QSA,L]
</IfModule>

# UTF-8 varsayılan (Türkçe karakter güvenliği)
AddDefaultCharset UTF-8
<IfModule mod_mime.c>
    AddCharset UTF-8 .html .css .js .json
    AddType video/mp4 .mp4
    AddType video/webm .webm
</IfModule>

# Hassas dosyaları koru
<FilesMatch "^(config\.php|.*\.sql|.*\.md)$">
    Require all denied
</FilesMatch>

# Statik dosya önbelleği (jet hız)
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType image/webp "access plus 1 year"
    ExpiresByType image/svg+xml "access plus 1 year"
    ExpiresByType video/mp4 "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml text/plain application/xml
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(css|js)$">
        Header set Cache-Control "public, max-age=2592000, immutable"
    </FilesMatch>
    <FilesMatch "\.(jpg|jpeg|png|webp|gif|svg|ico|mp4|webm|woff2)$">
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
</IfModule>
