Dodano blokowanie niepożądanych botów w pliku .htaccess
This commit is contained in:
96
.htaccess
96
.htaccess
@@ -112,3 +112,99 @@ ErrorDocument 404 /index.php?controller=404
|
||||
|
||||
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
|
||||
|
||||
# =============================================================================
|
||||
# BLOKOWANIE NIEPOZADANYCH BOTOW
|
||||
# Dodano: 2026-02-18
|
||||
# =============================================================================
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
|
||||
# --- Duzy ruch, brak korzysci ---
|
||||
|
||||
# Python scrapers (10% ruchu)
|
||||
RewriteCond %{HTTP_USER_AGENT} python [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# AhrefsBot - komercyjny crawler SEO (9.9% ruchu, 2.9GB)
|
||||
RewriteCond %{HTTP_USER_AGENT} ahrefsbot [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# MJ12bot - Majestic SEO (5.4% ruchu, 1.4GB)
|
||||
RewriteCond %{HTTP_USER_AGENT} mj12bot [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Wget - narzedzie do pobierania/scrapowania (4.8% ruchu)
|
||||
RewriteCond %{HTTP_USER_AGENT} wget [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# SemrushBot - crawler SEO (1.5% ruchu)
|
||||
RewriteCond %{HTTP_USER_AGENT} semrushbot [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# BaiduSpider - chinska wyszukiwarka (bezuzyteczna dla PL)
|
||||
RewriteCond %{HTTP_USER_AGENT} baiduspider [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Brak User-Agent - podejrzany ruch (1.2% ruchu, 2.4GB!)
|
||||
RewriteCond %{HTTP_USER_AGENT} ^-?$
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# CCBot - Common Crawl (zbieranie danych do AI)
|
||||
RewriteCond %{HTTP_USER_AGENT} ccbot [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# 360Spider - chinska wyszukiwarka
|
||||
RewriteCond %{HTTP_USER_AGENT} 360spider [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# --- Maly ruch, bezuzyteczne ---
|
||||
|
||||
# DotBot - Moz crawler
|
||||
RewriteCond %{HTTP_USER_AGENT} dotbot [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Yandex - rosyjska wyszukiwarka
|
||||
RewriteCond %{HTTP_USER_AGENT} yandex [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Scanner - skanery bezpieczenstwa
|
||||
RewriteCond %{HTTP_USER_AGENT} scanner [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# curl - narzedzie CLI
|
||||
RewriteCond %{HTTP_USER_AGENT} ^curl [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# libwww - biblioteka Perl
|
||||
RewriteCond %{HTTP_USER_AGENT} libwww [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Java bot
|
||||
RewriteCond %{HTTP_USER_AGENT} ^java [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Falszywy/okrojony User-Agent (dokladnie "Mozilla/5.0" i nic wiecej)
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/5\.0$
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# PHP bot
|
||||
RewriteCond %{HTTP_USER_AGENT} ^php [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# fast-webcrawler
|
||||
RewriteCond %{HTTP_USER_AGENT} fast-webcrawler [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Netcraft - skaner
|
||||
RewriteCond %{HTTP_USER_AGENT} netcraft [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Motor - nieznany bot
|
||||
RewriteCond %{HTTP_USER_AGENT} ^motor [NC]
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
</IfModule>
|
||||
# =============================================================================
|
||||
# KONIEC BLOKOWANIA BOTOW
|
||||
# =============================================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user