Preventing DDOS attacks on your website
This line of code below disallows blank useragents to your website. This normally prevents bots and auto-generated spambots from hitting the site causing the server to slow down tremendously. Simply add the line of code in your script just before it loads the layout.
if(($_SERVER['HTTP_USER_AGENT'] == "") || ($_SERVER['HTTP_USER_AGENT'] == "-")){
die();
}
This will disallow all user agents with no name or with a – in the name.
thats it, quite simple..
credits: Kenetix
About this entry
You’re currently reading “Preventing DDOS attacks on your website,” an entry on My Weblog
- Published:
- October 9, 2006 / 3:33 pm
- Category:
- projects
- Tags:
No comments yet
Jump to comment form | comment rss [?] | trackback uri [?]