Options -Indexes

<IfModule mod_rewrite.c>
  RewriteEngine On
  # 短链调用：/api/接口编码 -> api/index.php?code=接口编码（接口编码可含中划线）
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^api/([a-zA-Z0-9_-]+)/?$ api/index.php?code=$1 [QSA,L]
</IfModule>

# 内核与数据目录禁止直接访问（这些文件只由程序内部 include）
RedirectMatch 403 ^/(core|native|data|sql)/

# 敏感文件禁止下载
<FilesMatch "^(config\.php|.*\.sql|.*\.log|.*\.lock|.*\.conf)$">
  Require all denied
</FilesMatch>

# PATH_INFO 支持（/api/index.php/接口编码）；Apache 需要开启 AcceptPathInfo
AcceptPathInfo On
