# Bursa Oto Teknik Servis – Apache / cPanel yapılandırması
DirectoryIndex index.php

<IfModule mod_rewrite.c>
  RewriteEngine On

  # HTTPS'e yönlendir (localhost ve geliştirme ortamı hariç)
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteCond %{HTTP_HOST} !^(localhost|127\.0\.0\.1)(:\d+)?$ [NC]
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  # İsterseniz www olmayan adresi www'ye yönlendirmek için aşağıdaki iki satırın başındaki # işaretini kaldırın:
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  # Gerçek dosya/klasörler (css, js, img, uploads, admin) olduğu gibi servis edilir
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # Diğer her şey ön denetleyiciye
  RewriteRule ^ index.php [L,QSA]
</IfModule>

# Hassas klasörler ve dosyalar dışarıdan erişilemez
<IfModule mod_alias.c>
  RedirectMatch 403 ^/(content|inc|views|cache)(/|$)
</IfModule>
<FilesMatch "^(config\.php|config\.sample\.php|README\.md|\.user\.ini)$">
  <IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
  <IfModule !mod_authz_core.c>
    Order allow,deny
    Deny from all
  </IfModule>
</FilesMatch>

# Sıkıştırma ve tarayıcı önbelleği
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml application/xml
</IfModule>
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
  Header set X-Frame-Options "SAMEORIGIN"
</IfModule>
