今天在网上看到一篇防DDOS的文章,很有意思,转载学习一下:
It’s a easy way to protect your website. 这是一个非常简单的方法来保护你的网站 But it will block any request from China. 但是它将屏蔽所有来自中国的访问请求 So please remove it after the attack. 所以在攻击停止以后请删除它
在网站程序中加入以下这段代码。
<?php if(strpos($_SERVER['REQUEST_URI'],’minghui’) === false) { header(‘Location:’. $_SERVER['REQUEST_URI'] . ‘?minghui’); exit; } ?>
If you are in China, you can visit http://vii.im/gfw-test.php to test。 如果你在中国,你可以访问http://vii.im/gfw-test.php来测试效果。 |