RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^(.*)$ $1.php [L,QSA]
RewriteCond %{REQUEST_FILENAME}.htm -f [NC]
RewriteRule ^(.*)$ $1.htm [L,QSA]
RewriteCond %{REQUEST_FILENAME}.html -f [NC]
RewriteRule ^(.*)$ $1.html [L,QSA]

# Tentukan halaman error
ErrorDocument 404 /404.php

# Izinkan folder tertentu (misal assets, uploads)
RewriteCond %{REQUEST_URI} ^/(assets|uploads) [NC]
RewriteRule ^ - [L]

# Jika mengakses folder tanpa index, alihkan ke 404
Options -Indexes

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php83” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php83___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
