I did a similar thing on my site, but I was altering the output based on what domain someone was using to access my site, but the principle is the same.
As the first line in your PHP try something like this:
$referrer = $_SERVER['HTTP_REFERER'];
if($referrer == 'bad_url')
{
header("Location: someplace_else.php");
}
Alternatively, you could change the $referrer for the IP address of the offending data miner with $ip=$_SERVER['REMOTE_ADDR']; and compare it with the dotted-decimal IP address in your stats.
Oh, and for giggles, I'd make that someplace_else.php file something really rubbish, like some sort of ipsum generator (or something less savoury like pr0n depending on how your morals lie) in the hope that the data miners give up entirely.