# BEGIN LSCACHE
# END LSCACHE
# BEGIN NON_LSCACHE
# END NON_LSCACHE

# ============================================
# CEMOZLUK.COM - OPTİMİZE .htaccess (REVİZE)
# ============================================

# GZIP COMPRESSION
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
    AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE application/json application/xml
    AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
# BROTLI COMPRESSION (Eğer destekliyorsa)
<IfModule mod_brotli.c>
    AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json application/xml
</IfModule>

# CACHE OPTIMIZATION - WEBP DESTEĞİ
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{REQUEST_URI} (.+)\.(jpe?g|png)$
    RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
    RewriteRule ^(.+)$ $1.webp [L,T=image/webp]
</IfModule>

<IfModule mod_headers.c>
    # WEBP DESTEĞİ HEADER
    <FilesMatch "\.(jpe?g|png)$">
        Header append Vary Accept
    </FilesMatch>
    
    # CACHE HINTS
    Header set X-Cache-Hint "optimized"
</IfModule>

# BROWSER CACHING - OPTIMUM
<IfModule mod_expires.c>
    ExpiresActive On
    
    # HTML - 1 saat
    ExpiresByType text/html "access plus 1 hour"
    
    # CSS & JS - 1 ay
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 month"
    
    # Görseller - 6 ay
    ExpiresByType image/jpg "access plus 6 months"
    ExpiresByType image/jpeg "access plus 6 months"
    ExpiresByType image/png "access plus 6 months"
    ExpiresByType image/gif "access plus 6 months"
    ExpiresByType image/webp "access plus 6 months"
    ExpiresByType image/x-icon "access plus 6 months"
    ExpiresByType image/svg+xml "access plus 6 months"
    
    # Fontlar - 6 ay
    ExpiresByType font/woff "access plus 6 months"
    ExpiresByType font/woff2 "access plus 6 months"
    ExpiresByType application/x-font-ttf "access plus 6 months"
    ExpiresByType application/x-font-opentype "access plus 6 months"
</IfModule>

# CACHE CONTROL HEADERS
<IfModule mod_headers.c>
    # CSS & JS için cache
    <FilesMatch "\.(css|js)$">
        Header set Cache-Control "public, max-age=2592000, stale-while-revalidate=86400"
    </FilesMatch>
    
    # Görseller için cache
    <FilesMatch "\.(jpg|jpeg|png|gif|webp|ico)$">
        Header set Cache-Control "public, max-age=15552000, immutable"
    </FilesMatch>
    
    # Fontlar için cache
    <FilesMatch "\.(woff|woff2)$">
        Header set Cache-Control "public, max-age=15552000, immutable"
    </FilesMatch>
    
    # SVG için cache
    <FilesMatch "\.svg$">
        Header set Cache-Control "public, max-age=15552000, immutable"
    </FilesMatch>
    
    # Remove ETag (optional for better caching)
    Header unset ETag
</IfModule>

FileETag None

# 404 HATASI ÖNLEME - RESİMLER İÇİN
<IfModule mod_rewrite.c>
    RewriteEngine On
    # Kayıp resimler için 404'ü önle
    RewriteCond %{REQUEST_URI} \.(png|jpg|jpeg|gif|webp)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* - [R=404,L]
</IfModule>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^en/wp-login.php /wp-login.php [QSA,L]
RewriteRule ^de/wp-login.php /wp-login.php [QSA,L]
RewriteRule ^ru/wp-login.php /wp-login.php [QSA,L]
RewriteRule ^tr/wp-login.php /wp-login.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

# BEGIN cPanel-generated php ini directives, do not edit
<IfModule php8_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 999M
   php_value post_max_size 999M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php81"
   php_value upload_max_filesize 999M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 999M
   php_value post_max_size 999M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php81"
   php_value upload_max_filesize 999M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# “ea-php81” paketini varsayılan “PHP” programlama dili olarak ayarlayın.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

# BEGIN seraphinite-accelerator
# "BEGIN seraphinite-accelerator" ve "END seraphinite-accelerator" arasındaki yönergeler (satırlar)
# dinamik olarak oluşturulmuştur ve yalnızca WordPress süzgeçleri ile düzenlenmelidir.
# Bu imler arasındaki yönergelerde yapılan değişikliklerin üzerine yazılır.

# END seraphinite-accelerator