RewriteEngine On

# HTTP'den HTTPS'e yönlendirme
RewriteCond %{SERVER_PORT} 80
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

# www'dan non-www'ya yönlendirme
RewriteCond %{HTTP_HOST} ^www\.hesapkurtarma\.net [NC]
RewriteRule ^(.*)$ http://hesapkurtarma.net/$1 [L,R=301]

# 404 sayfasına yönlendirme
ErrorDocument 404 /404.html

# Önbellekleme politikaları
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "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"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
</IfModule>

# Cache-Control başlıkları
<IfModule mod_headers.c>
    Header set Cache-Control "max-age=31536000, public"
</IfModule>

# HTML dosyaları için önbellekleme
<FilesMatch "\.(html|htm)$">
    Header set Cache-Control "max-age=600, public"
</FilesMatch>
