From a performance only view, which would be the best way to block 30 IP addresses?
A) .htaccess file
or
B) PHP code in the file
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are administrator of your server, I would use none of those, and would ban the IPs at the firewall level — this way, nor Apache nor Apache+PHP will have to work.
If you’re not admin ; well,
.htaccessmeans only Apache, and no PHP to load/compile/execute ; I’m guessing Apache alone (i.e..htaccess) should require less resources than Apache+PHP.Another way of seing things is maintenance : if you need to add/delete IPs addresses from that list, what would the easiest way be ?
(In that case, I would generally bet for some PHP code…)