# Apache / Hostinger equivalent of public/_redirects.
# Use this file only when deploying to Hostinger; Cloudflare Pages reads
# _redirects instead. Keep the two in sync.

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Legacy WordPress endpoints that no longer exist on a static site.
  RewriteRule ^wp-admin(/.*)?$      / [R=301,L]
  RewriteRule ^wp-login\.php$       / [R=301,L]
  RewriteRule ^feed(/.*)?$          / [R=301,L]
  RewriteRule ^comments/feed(/.*)?$ / [R=301,L]

  # Enforce trailing slashes so URLs match the live site exactly.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} !(/$|\.[a-zA-Z0-9]{2,5}$)
  RewriteRule ^(.*)$ /$1/ [R=301,L]
</IfModule>

ErrorDocument 404 /404.html

# Long-cache fingerprinted assets; keep HTML fresh.
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css                "access plus 1 year"
  ExpiresByType application/javascript  "access plus 1 year"
  ExpiresByType image/webp              "access plus 1 year"
  ExpiresByType image/avif              "access plus 1 year"
  ExpiresByType font/woff2              "access plus 1 year"
  ExpiresByType text/html               "access plus 0 seconds"
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript image/svg+xml
</IfModule>
