# UMUCYO SACCO RWAMAGANA — Apache / cPanel settings

DirectoryIndex index.html
Options -Indexes
ErrorDocument 404 /404.html

# --- Force HTTPS -------------------------------------------------------------
# Uncomment once an SSL certificate is active (cPanel > SSL/TLS Status / AutoSSL).
# <IfModule mod_rewrite.c>
#   RewriteEngine On
#   RewriteCond %{HTTPS} off
#   RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# </IfModule>

# --- File types --------------------------------------------------------------
<IfModule mod_mime.c>
  AddType image/webp .webp
  AddType application/manifest+json .webmanifest
  AddCharset utf-8 .html .css .js .xml .txt .webmanifest
</IfModule>

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

# --- Browser caching ---------------------------------------------------------
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 week"
  ExpiresByType text/html "access plus 0 seconds"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType application/pdf "access plus 1 month"
</IfModule>

# --- Security headers --------------------------------------------------------
<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
  Header always set X-Frame-Options "SAMEORIGIN"
  <FilesMatch "\.pdf$">
    Header set Content-Disposition "attachment"
  </FilesMatch>
</IfModule>
