ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
黑名单,禁止某些ip访问 定义在VirtualHost中 ~~~ RewriteEngine on RewriteMap hosts-deny "txt:/path/to/hosts.deny" RewriteCond "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR] RewriteCond "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND" RewriteRule "^" "-" [F] ~~~ 黑名单格式,改动后不用重新加载配置文件 ~~~ ## hosts.deny ## ## ATTENTION! This is a map, not a list, even when we treat it as such. ## mod_rewrite parses it for key/value pairs, so at least a ## dummy value "-" must be present for each entry. ## 193.102.180.41 - bsdti1.sdm.de - 192.76.162.40 - ~~~ 参考文档:http://httpd.apache.org/docs/2.4/rewrite/access.html