# Next.js için Apache yapılandırması
# Paylaşımlı hosting'de Next.js çalıştırmak için

# Node.js uygulamasını çalıştır (eğer hosting Node.js destekliyorsa)
# Bu dosya sadece Apache yönlendirmesi için kullanılır

# Tüm istekleri Next.js'e yönlendir
<IfModule mod_rewrite.c>
  RewriteEngine On
  
  # Eğer dosya veya klasör yoksa, Next.js'e yönlendir
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ http://localhost:${PORT:-3000}/$1 [P,L]
  
  # Alternatif: Eğer hosting Node.js modülü kullanıyorsa
  # RewriteRule ^(.*)$ /index.js [L]
</IfModule>

# Gzip sıkıştırma
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>

# Cache ayarları
<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/javascript "access plus 1 month"
</IfModule>

