Re: 404 errors

From: Date: Wed, 17 May 2006 00:18:18 +0000
Subject: Re: 404 errors
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-236311@lists.php.net to get a copy of this message
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

« previous php.general (#236311) next »