Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

ban by useragent


Recommended Posts

is this possible?


i'm currently using this code:

function banned_redirect($to, $code = '301 Moved Permanently') {
header("HTTP/1.1 ".$code);
header("Location: http://$to");
$user_agent = strtolower(getenv('HTTP_USER_AGENT'));
$banned_ua = array ('jakarta commons-httpclient/3.0-rc4','java/1.4.1_04','java/1.4.2_06','java/1.5.0_06');
$n = sizeof($banned_ua);
for ($i=0;$i<$n;$i++) {
if (stristr($user_agent,$banned_ua[$i])) banned_redirect('www.thejakartapost.com/headlines.asp');

supplied by boxtel, but this blasted java bot (usually java/1.4.1_04) keeps coming back and scanning my site


this is how the bot appears in whos_online:

Name: java/1.4.1_04

User Agent: java/1.4.1_04



am i possibly entering the useragent string incorrectly?

ip bans do not work. each day it comes back with a completely new ip from a different part of the world

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...