# ============================================================
# MIZZE Key Server — Apache config (cPanel)
# ============================================================
Options -Indexes

# ---- Rewrite API v1: /api/v1/activate và /api/v1/renew -> api.php ----
# Patch client nhúng base URL "https://brian1.tlong8m5.store" (21 ký tự, vừa khít chuỗi cũ
# nên không đệm) — client gọi thẳng /api/v1/activate. Rule ^/{0,2} vẫn nhận 0/1/2 slash đầu.
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^/{0,2}api/v1/(activate|renew)/?$ api.php?ep=$1 [L,QSA]
</IfModule>

# ---- Chặn truy cập trực tiếp file cấu hình / thư viện ----
<FilesMatch "^(config|lib)\.php$">
  <IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
  <IfModule !mod_authz_core.c>
    Order allow,deny
    Deny from all
  </IfModule>
</FilesMatch>

# ---- Không cache các trang PHP ----
<IfModule mod_headers.c>
  <FilesMatch "\.php$">
    Header set Cache-Control "no-store, no-cache, must-revalidate"
  </FilesMatch>
</IfModule>
