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

# Turn on the Rewrite Engine
RewriteEngine On

# Rewrite base (optional: useful for subfolders, adjust if necessary)
# RewriteBase /

# Remove the 'index.php' from the URL
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

# Force HTTPS (uncomment the next lines if you want to enforce HTTPS)
# RewriteCond %{HTTPS} off
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Redirect to a 404 page for any requests for .php files
RewriteCond %{REQUEST_URI} \.php$
RewriteRule ^(.*)$ /404 [L,R=301]

# Redirect any .html or other non-PHP URLs to the index.php controller
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)$ index.php/$1 [L]

# Block access to the system and application directories
RewriteRule ^(system|application|assets|.git|.svn) - [F,L]