# Redirect old doc paths to new ones — using RewriteRule for broader compatibility
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^docs/product-overview/?$ /docs/overview/ [R=301,L]
  RewriteRule ^docs/deploy-first-service/?$ /docs/first-service/ [R=301,L]
  RewriteRule ^docs/premium-features/?$ /docs/premium/ [R=301,L]
  RewriteRule ^docs/infrastructure/?$ /docs/integrations/ [R=301,L]
</IfModule>

# Fallback using mod_alias Redirect if available
<IfModule mod_alias.c>
  Redirect 301 /docs/product-overview /docs/overview/
  Redirect 301 /docs/deploy-first-service /docs/first-service/
  Redirect 301 /docs/premium-features /docs/premium/
  Redirect 301 /docs/infrastructure /docs/integrations/
</IfModule>

# Set cache headers for static assets
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
  ExpiresByType image/x-icon "access plus 1 year"
</IfModule>

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

# Custom 404 page
ErrorDocument 404 /404.html
