Drupal
服务器支持 php_value 时,Drupal 推荐使用 .htaccess auto_prepend_file,让 AWAF 在 Drupal PHP 文件和其他 endpoint 前启动。
推荐方式
Apache mod_php 且允许 php_value 时,在 Drupal 根目录 .htaccess 中添加该指令,并使用 AWAF 的绝对路径。
php_value auto_prepend_file "<目录路径>/antibot/index.php"覆盖
AWAF 会在 index.php、update.php、cron.php 和范围内其他 PHP endpoint 前加载,减少只接入前端控制器造成的 admin、AJAX、旧脚本或服务文件空白。
回退
PHP-FPM、CGI、纯 Nginx 或禁止 php_value 时,使用 .user.ini、vhost/pool 配置或早期公共入口点,通常是 index.php。这个回退方案不如 auto_prepend_file 通用,因此需要检查后台、AJAX、update.php、cron.php 和直接 PHP endpoint。
验证
- 测试首页、node/page、taxonomy、搜索和 404。
- 测试 /user/login、后台 URL、AJAX、JSON/API、update.php 和可 web 访问的 cron.php。
- 检查表单、sitemap/XML 和模块集成。
- 查看 RayID 后为服务 URL 添加精确 whitelist_url。