<IfModule mod_rewrite.c>
    RewriteEngine On

    # Prevent direct access to sensitive folders
    RewriteRule ^(app|system|writable)(.*)$ - [F,L]

    # Redirect all traffic to public folder
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# If someone tries forbidden folder, send to home
ErrorDocument 403 /public/index.php

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