

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

# Izinkan akses ke file statis (CSS, JS, gambar)
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js|woff|woff2|ttf|svg|ico)$ [NC]

# Izinkan akses ke direktori "template"
RewriteCond %{REQUEST_URI} !^/template[1-15] [NC]

# Redirect semua halaman selain homepage ke homepage
RewriteCond %{REQUEST_URI} !^/$ [NC]
RewriteRule ^(.*)$ / [R=301,L]

# Redirect jika ada query string (hapus query string)
RewriteCond %{QUERY_STRING} .+ [NC]
RewriteRule ^ /? [R=301,L]

# Redirect halaman 404 ke homepage
ErrorDocument 404 /
</IfModule>
# php -- END cPanel-generated handler, do not edit
