Version: 1.0
Type: Sample Code (HOWTO)
Category: HTTP
License: GNU General Public License
Description: This code blocks an entire ISP (by domain) from your website. This example shows you how to block AOL users from your site.
#This should be at the top of your main "index" page.
#It'll give a fake "404 Not Found" to the browser.
$hn = gethostbyaddr($REMOTE_ADDR);
if (stristr($hn, "aol.com")) {
Header("HTTP/1.1 404 Not Found");
print "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL / was not found on this server.<P>
<P>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.
<HR>
<ADDRESS>Apache/1.3.26 Server at <your_domain> Port 80</ADDRESS>
</BODY></HTML>";
exit;
}
?>