Joomla
Apache/PHP 支持时,Joomla 推荐使用 .htaccess auto_prepend_file;这比只在一个入口文件中 include 覆盖更完整。
推荐方式
Apache mod_php 且允许 php_value 时,在 Joomla 根目录 .htaccess 中添加该指令,并使用 AWAF 的绝对路径。
php_value auto_prepend_file "<目录路径>/antibot/index.php"覆盖
AWAF 会在范围内 PHP 文件前启动,包括公开 index.php、administrator/index.php、ajax/component endpoint、旧脚本和服务处理器。
回退
PHP-FPM、CGI、纯 Nginx 或禁止 php_value 时,使用 .user.ini、vhost/pool 配置或项目早期入口点,通常是 index.php。这个回退方案不如 auto_prepend_file 通用,因此需要检查 administrator、AJAX/component endpoint、API/feeds 和直接 PHP endpoint。
验证
- 测试首页、文章、分类、搜索和 404。
- 测试 /administrator/、登录、AJAX/component endpoint、API/feeds 和 sitemap/XML。
- 检查表单、支付、扩展 callback 和 cron/webcron。
- 对不适合验证码的 endpoint 添加精确 whitelist_url/captcha_uri。