RewriteEngine On

# Pastikan penggunaan HTTPS
#RewriteCond %{HTTPS} off
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Jika file atau direktori tidak ditemukan, arahkan ke index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

# Mencegah akses langsung ke file-file default CodeIgniter
<FilesMatch "^(config\.php|\.htaccess|\.txt|\.gitattributes|\.editorconfig|LICENSE\.(txt|md)|\.gitignore|composer\.json|composer\.lock)$">
    Deny from all
</FilesMatch>

# 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
