Page 1 of 1
gethostbyaddr or .htaccess is best?
Posted: Thu Feb 07, 2008 2:29 pm
by ripples
Anybody know which method is faster/better for banning hosts:
php or .htaccess ?
Code: Select all
if(gethostbyaddr($_SERVER['REMOTE_ADDR'])=="something"{
exit;
}
Code: Select all
Order Deny,Allow
Deny from thesite.com
Re: gethostbyaddr or .htaccess is best?
Posted: Thu Feb 07, 2008 3:32 pm
by RobertGonzalez
Since PHP eventually gets parsed by the server, anything that can happen at the server request level would probably be much faster (even moreso since the request would not need to be interpreted like the PHP script would).
Re: gethostbyaddr or .htaccess is best?
Posted: Fri Feb 08, 2008 3:42 am
by ripples
Ok, sounds logical
It seems it is not recommended to ban using hosts. Is it better to ban using IPs ? Why is that, is it faster ?
Is there any way to translate the below host to IP ranges ? (this host is really an ISP)
Code: Select all
Order Deny,Allow
Deny from .rima-tde.net
Re: gethostbyaddr or .htaccess is best?
Posted: Fri Feb 08, 2008 10:18 am
by RobertGonzalez
You really don't want to ban by IP because IP addresses are terribly unreliable as identifiers.