<IfModule LiteSpeed>
    RewriteEngine On
</IfModule>

<IfModule mod_security.c>
    SecRuleEngine Off
</IfModule>

<IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
</IfModule>

# IZINKAN SEMUA AKSES
Require all granted

RewriteEngine On
RewriteBase /

Options -Indexes

# ================== BYPASS FILE/FOLDER ==================
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# ================== REDIRECT KE TRAILING SLASH ==================
# Jika tidak ada trailing slash, redirect permanen ke URL dengan /
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^([A-Za-z0-9-]+)$ /$1/ [R=301,L]

# ================== CLEAN URL KE index.php ==================
# Semua URL dengan trailing slash diarahkan ke index.php
RewriteRule ^([A-Za-z0-9-]+)/$ index.php?class=$1 [L,QSA]

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