DirectoryIndex index.html index.php

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  # Redirect legacy /equipment to /products/
  RewriteRule ^equipment/(.*)$ /products/$1 [R=301,L]
  RewriteRule ^equipment$ /products/ [R=301,L]

  # Serve index.html inside directories if it exists
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteCond %{REQUEST_FILENAME}/index.html -f
  RewriteRule ^(.*)$ $1/index.html [L]

  # Serve .html file if request matches a filename without extension
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}.html -f
  RewriteRule ^(.*)$ $1.html [L]

  # Serve 404.html if page not found
  ErrorDocument 404 /404.html
</IfModule>
