Cách hạn chế tấn công DDOS ?






Bước 1: Tạo file .htaccess tại thư mục bị DDoS access/request liên tục (thông thường là các thư mục public_html, forum,...). Nội dung file như sau:


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?tendomain.com [NC]
RewriteRule !antiddos.phtml http://tendomain.com/antiddos.phtml?%{REQUEST_URI} [QSA]


Bước 2: Tại cùng thư mục file .htaccess , tạo file antiddos.phtml với nội dung:


<?php
$text=$HTTP_SERVER_VARS['QUERY_STRING'];
$text = preg_replace("#php\&#si",'php?',$text);
echo('<div><a href=http://tendomain.com'.$text.'>Welcome</div>');
?>


Tag: thiet kế website cần giụôc, thiết kế website long an

Nhận xét

Bài đăng phổ biến từ blog này

Hướng dẫn tạo database migration bằng PHP

Template html waiting

Khắc phục sự cố mail outlook tự động gửi nhiều mail cùng nội dung.