# ==========================================================
# iHolic - Apache & cPanel Web Server Configuration
# ==========================================================

Options -Indexes
Options +FollowSymLinks

# Enable Rewrite Engine
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  # Block direct access to sensitive database and log files
  <FilesMatch "\.(sqlite|sql|log|ini|sh|env)$">
    Require all denied
  </FilesMatch>
</IfModule>

# Security Headers
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set X-Frame-Options "SAMEORIGIN"
  Header set X-XSS-Protection "1; mode=block"
</IfModule>

# Increase upload limits for product photos and video showcase
<IfModule mod_php7.c>
  php_value upload_max_filesize 64M
  php_value post_max_size 70M
  php_value memory_limit 128M
</IfModule>

<IfModule mod_php8.c>
  php_value upload_max_filesize 64M
  php_value post_max_size 70M
  php_value memory_limit 128M
</IfModule>

# Caching for performance
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/webp "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
  ExpiresByType text/css "access plus 1 week"
  ExpiresByType application/javascript "access plus 1 week"
</IfModule>
