Re: 404 errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 16, 2006 3:56 pm, John Taylor-Johnston wrote:
> I get a lot of 404 errors. Is there a way in PHP to redirect them in
> such a way as it does not burn my bandwidth? Or (an Apache trick I
> learned once) to discourage them by referring them to localhost? Or
> something? Something I can embed in PHP.

header("Location: 127.0.0.1");

would be the PHP equivalent of that Apache trick.

Not sure how effective it is...

Another option is to do this:

<?php
  if (bad_user()){
    sleep(mt_rand(1, 60));
  }
?>

You have to figure out a way to code bad_user() to only catch the bad
guys, but they'll decide your server is "too slow" to be useful, or
that they've trashed it with their DOS attack, and move on to another
victim.

Honestly, though, PHP is almost-for-sure the wrong place to attack
this problem...

Not saying I know what is the RIGHT place, mind. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux