# ------------------------------------------------------------
#  Platforma balti de pescuit — Apache / LiteSpeed
# ------------------------------------------------------------
Options -Indexes -MultiViews
DirectoryIndex index.php
AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
  RewriteEngine On

  # HTTPS fortat
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  # Zone interzise
  RewriteRule ^(includes|logs|backups|templates|pages)(/|$) - [F,L]
  RewriteRule ^(config|config\.local)\.php$ - [F,L]
  RewriteRule \.(sql|md|log|bak|ini|json\.lock)$ - [F,L]

  # Fisierele si folderele reale se servesc direct
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  RewriteRule ^ index.php [L,QSA]
</IfModule>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  <FilesMatch "\.(css|js|woff2?|svg|png|jpe?g|webp|gif|ico)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"
  ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

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

<FilesMatch "^(\.|composer\.|INSTALARE)">
  Require all denied
</FilesMatch>
