Duck hunt

»

Đăng: 2016-02-23 12:44
AdminPichu    [Admin]
Để chặn bot user-agent cộng code dưới vào file .htaccess

#block bad bots with a 403
SetEnvIfNoCase User-Agent "facebookexternalhit" bad_bot
SetEnvIfNoCase User-Agent "Twitterbot" bad_bot
SetEnvIfNoCase User-Agent "Baiduspider" bad_bot
SetEnvIfNoCase User-Agent "MetaURI" bad_bot
SetEnvIfNoCase User-Agent "mediawords" bad_bot
SetEnvIfNoCase User-Agent "FlipboardProxy" bad_bot

<Limit GET POST HEAD>
  Order Allow,Deny
  Allow from all
  Deny from env=bad_bot
</Limit>

Copy code



Hoặc code này nếu muốn chuyển nó đến 1 trang khác:

#redirect bad bots to one page
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} facebookexternalhit [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Twitterbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Baiduspider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} MetaURI [NC,OR]
RewriteCond %{HTTP_USER_AGENT} mediawords [NC,OR]
RewriteCond %{HTTP_USER_AGENT} FlipboardProxy [NC]
RewriteCond %{REQUEST_URI} !\/nocrawler.htm
RewriteRule .* http://pichu.wap.sh [L]

Copy code
Like: 0
Trực tuyến:
khách: 1
23 Chat - 65 member - 1226559 Views
-
Trang chủ
Google Robots Sitemap
Country : pokemon chim
IP : 3.128.197.164
Host : ec2-3-128-197-164.us-east-2.compute.amazonaws.com
Bây giờ là : 10:06:16 16/05/2024
Thanks to Xtgem.com Load xtscript: 0.000001s.
Timeload : 0.0007/s Timeout : 0.7%