# Walker & Vine — static hosting (cPanel / Apache)

Options -Indexes
DirectoryIndex index.html

ErrorDocument 404 /404.html

<IfModule mod_mime.c>
  AddType application/xml .xml
  AddType image/svg+xml .svg
  AddType application/manifest+json .webmanifest
</IfModule>

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

# Browser caching
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/html "access plus 1 hour"
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 month"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType font/woff2 "access plus 1 year"
  ExpiresByType application/xml "access plus 1 day"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\.(?:js|css|jpg|jpeg|png|webp|svg|woff2)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
  <FilesMatch "\.html$">
    Header set Cache-Control "public, max-age=3600, must-revalidate"
  </FilesMatch>
  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

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

# Pretty URLs — Apache already serves /about/ from /about/index.html via DirectoryIndex.
# Add trailing slash redirect for SEO consistency
<IfModule mod_rewrite.c>
  RewriteEngine On
  # If a request matches a directory without trailing slash and that directory has an index.html, Apache handles it.
  # Strip .html extension
  RewriteCond %{THE_REQUEST} \s/+([^?\s]+)\.html[?\s]
  RewriteRule ^ /%1 [R=301,L]
</IfModule>
