# KOJTRUST CONSTRUCTION - SEO & Performance Optimization

# Enable Gzip Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>

# Browser Caching
<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 image/webp "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/pdf "access plus 1 month"
  ExpiresByType text/html "access plus 1 hour"
</IfModule>

# Redirect www to non-www (optional - adjust as needed)
# RewriteEngine On
# RewriteCond %{HTTP_HOST} ^www\.kojtrustconstruction\.com [NC]
# RewriteRule ^(.*)$ https://kojtrustconstruction.com/$1 [L,R=301]

# Force HTTPS (uncomment when SSL is installed)
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# 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"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# Prevent Directory Browsing
Options -Indexes

# Custom Error Pages (optional)
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html

# UTF-8 Encoding
AddDefaultCharset UTF-8
