使用htaccess通过IP地址限制用户

时间:2014-06-18 15:11:15

标签: php apache .htaccess mod-rewrite

我正在寻找一种通过htaccess,php和文件系统按IP地址限制请求的方法。

遵循以下步骤:

    php中的
  1. :如果在很短的时间内创建root / ips / xxx-xxx-xxx-xxx.txt
  2. 的请求太多
  3. in htaccess:RewriteCond %{DOCUMENT_ROOT}/ips/%{REMOTE_ADDR}\.txt -f
  4. 在htaccess中:如果文件存在重定向到/too_busy_right_now_sorry.php,标题刷新5秒
  5. 在php:unlink(root / ips / xxx-xxx-xxx-xxx.txt)
  6. 在Apache中按IP地址限制请求的最佳做法是什么?

0 个答案:

没有答案
相关问题