RewriteEngine On

# Hilangkan .html dari URL (redirect ke versi tanpa .html)
RewriteCond %{THE_REQUEST} \s/([^.]+)\.html [NC]
RewriteRule ^ /%1 [R=301,L]

# Kalau file tanpa .html diminta, arahkan ke file .html
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^/]+)$ $1.html [L]

# Support folder seperti /collections/all
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L]