Duck hunt

»

Đăng: 2016-02-23 03: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 - 1238162 Views
-
Trang chủ
Google Robots Sitemap
Country : United States United States pokemon chim
IP : 18.226.214.156
Host : ec2-18-226-214-156.us-east-2.compute.amazonaws.com
Bây giờ là : 13:48:26 14/03/2025
Thanks to Xtgem.com Load xtscript: 0.000000s.
Timeload : 0.0005/s Timeout : 1.1%