# php -- BEGIN cPanel-generated handler (SAFE TO KEEP)
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler


#   Disable directory listing
Options -Indexes


#   Protect sensitive files (logs, env, txt, ini)
<FilesMatch "\.(env|log|txt|ini)$">
    Order allow,deny
    Deny from all
</FilesMatch>


#  Disable access to hidden files (.git, .htaccess etc.)
<FilesMatch "^\.">
    Order allow,deny
    Deny from all
</FilesMatch>


# Enable rewrite engine
RewriteEngine On


# If file exists, serve directly
RewriteCond %{REQUEST_FILENAME} !-f

# If directory exists, serve directly
RewriteCond %{REQUEST_FILENAME} !-d

# Otherwise redirect all to index.php
RewriteRule ^ index.php [QSA,L]