DOS/DDOS is just one of the ways your competitor can do to make your website down. They can’t just admit the fact that you outshine them, so they recourse to beating your site to its knees. Well don’t fret, I found a solution for you.
I found this Anti-DOS script and I hope it will be useful for users.
Just call the following line ON TOP of every .php file you want to protect
include(“anti_dos.php”); // Anti-DoS, prevents rapid accessing
Another PHP-based protection is Anti-Hammer, created and maintained by the folks at Corz. Its basically limits the access time of users to web pages, and if its way too fast, the “attacker” will be banned. It also includes script kiddie protection, bad bots and spiders, and Referer spammers.