# 禁止列目录（宝塔/Apache 未开 mod_autoindex 时不会报错）
<IfModule mod_autoindex.c>
  Options -Indexes
</IfModule>

# 默认入口
<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>

# 保护敏感文件，避免被直接下载
<FilesMatch "\.(md|json|lock|log|sql|ini|bak)$">
  <IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
  <IfModule !mod_authz_core.c>
    Order allow,deny
    Deny from all
  </IfModule>
</FilesMatch>

# 静态资源缓存
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 7 days"
  ExpiresByType application/javascript "access plus 7 days"
</IfModule>

# 关掉 PHP 版本暴露
<IfModule mod_headers.c>
  Header unset X-Powered-By
</IfModule>
