Options -Indexes
RewriteEngine On

# Handle /products/ (directory) to load products.html (file)

RewriteCond %{REQUEST_URI} ^/products/?$
RewriteRule ^products/?$ /products.html [L]

RewriteCond %{REQUEST_URI} ^/white-paper/?$
RewriteRule ^white-paper/?$ /white-paper.html [L]

# Redirect .html URLs to clean ones

RewriteCond %{THE_REQUEST} \s/+([^\s]+?)\.html[\s?] [NC]
RewriteRule ^ %1 [R=301,L]

# Rewrite clean URLs to .html files

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^(.*)/?$ /$1.html [L]
