Ban IPs from text file using htaccess
问题 I read and understand how to block an ip using htaccess: order deny,allow deny from 111.222.33.44 deny from 55.66.77.88 ... allow from all But my list of black IPs includes thousands of IPs. I save all IPs to a blacklist.txt file. Can I use htaccess to call blacklist.txt and block all IPs which are stored in this file? If so, how? 回答1: You can try using variations of RewriteMap. You'll need access to the server/vhost config because that directive only works there. You can then use the map