

RewriteEngine On

# Redireciona /index.html para /
RewriteRule ^index\.html$ / [R=301,L]

# Redireciona /index para /
RewriteRule ^index$ / [R=301,L]

# Redireciona de .html para URL sem extensão (ex: /contato.html → /contato)
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/([^.]+)\.html\sHTTP
RewriteRule ^([^.]+)\.html$ /$1 [R=301,L]

# Permite acessar páginas sem .html (ex: /contato → contato.html)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^/]+)$ $1.html [L]

# Garante que a página inicial seja o index.html
DirectoryIndex index.html

# php -- BEGIN cPanel-generated handler, do not edit
# Defina o pacote “ea-php81” como a linguagem padrão de programação “PHP”.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
