# ── PHP handler (REQUIRED on cPanel/EasyApache4) ─────────────────────────────
# Without this, .php files can be rejected with 403 under suexec/EA4 on some
# hosting accounts, even though the code itself is fine.
# Check Home >> Software >> MultiPHP Manager on this hosting account for the
# exact PHP version assigned to this domain/folder and match it below
# (e.g. ea-php82, ea-php83...). This matches bubblestechs.com's working config.
<IfModule mime_module>
    AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>

# ── Explicitly allow access (defeats any inherited "deny by default") ───────
<IfModule mod_authz_core.c>
    Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
    Order allow,deny
    Allow from all
</IfModule>

Options +FollowSymLinks -Indexes

# ── Route bare folder requests to /user/, leave /admin/ and /user/ alone ────
# RewriteBase is required here because this app lives in a SUBFOLDER
# (…/Chisokone/) rather than at the domain's true root.
RewriteEngine On
RewriteBase /Chisokone/

RewriteCond %{REQUEST_URI} !^/Chisokone/user/
RewriteCond %{REQUEST_URI} !^/Chisokone/admin/
RewriteRule ^(.*)$ /Chisokone/user/$1 [L]
