Limiter le nombre de hits par htaccess (ovh 60gp)

WRInaute discret
Bonjour je voudrais bloquer toute requete provenant de visiteurs non humain mise à part les robots de google. Est ce possible par htaccess ?

Exemple j'accepte toute requete d'un ordinateur dont le navigateur est du genre 'Mozilla/xxxxxxxxx' ou bien contient le mot "googlebot"


C'est parceque j'ai reçu plusieurs requetes abusives (10000 requete en 4h) de divers robots sur certaines de mes pages, ce qui m'a valu des avertissements de la part de mon hebergeur (ovh 60 gp).

Comment faire ?
merci de votre aide

cordialement
 
Olivier Duffez (admin)
Membre du personnel
mets un truc comme ça dans ton .htaccess :
Code:
#-----------------------------------------------------------------------------
# rejet en fonction des IP ou DNS
#-----------------------------------------------------------------------------
RewriteCond %{REMOTE_ADDR} ^63\.148\.99\.233$ [OR]
RewriteCond %{REMOTE_ADDR} ^81\.56\.23\.23$
RewriteRule .* - [F,L] 

RewriteCond %{REMOTE_HOST}  \.laurion\.net  [NC,OR] 
RewriteCond %{REMOTE_HOST} \.cn$ [OR] 
RewriteCond %{REMOTE_HOST} \.kr$ [OR] 
RewriteCond %{REMOTE_HOST} \.ro$ 
RewriteRule ^.*$   -   [F]

RewriteCond %{HTTP_USER_AGENT} Art-Online [OR] 
RewriteCond %{HTTP_USER_AGENT} BlackWidow [OR] 
RewriteCond %{HTTP_USER_AGENT} Bot\ mailto:craftbot@yahoo.com [OR] 
RewriteCond %{HTTP_USER_AGENT} ChinaClaw [OR] 
RewriteCond %{HTTP_USER_AGENT} DISCo [OR] 
RewriteCond %{HTTP_USER_AGENT} Download\ Demon [OR] 
RewriteCond %{HTTP_USER_AGENT} eCatch [OR] 
RewriteCond %{HTTP_USER_AGENT} efp@gmx.net [OR] 
RewriteCond %{HTTP_USER_AGENT} EirGrabber [OR] 
RewriteCond %{HTTP_USER_AGENT} EmailSiphon [OR] 
RewriteCond %{HTTP_USER_AGENT} Express\ WebPictures [OR] 
RewriteCond %{HTTP_USER_AGENT} ExtractorPro [OR] 
RewriteCond %{HTTP_USER_AGENT} EyeNetIE [OR] 
RewriteCond %{HTTP_USER_AGENT} FlashGet [OR] 
RewriteCond %{HTTP_USER_AGENT} GetRight [OR] 
RewriteCond %{HTTP_USER_AGENT} Go!Zilla [OR] 
RewriteCond %{HTTP_USER_AGENT} Go-Ahead-Got-It [OR] 
RewriteCond %{HTTP_USER_AGENT} GrabNet [OR] 
RewriteCond %{HTTP_USER_AGENT} Grafula [OR] 
RewriteCond %{HTTP_USER_AGENT} HMView [OR] 
RewriteCond %{HTTP_USER_AGENT} HTTrack [OR] 
RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [OR] 
RewriteCond %{HTTP_USER_AGENT} Image\ Stripper [OR] 
RewriteCond %{HTTP_USER_AGENT} Image\ Sucker [OR] 
RewriteCond %{HTTP_USER_AGENT} InterGET [OR] 
RewriteCond %{HTTP_USER_AGENT} Internet\ Ninja [OR] 
RewriteCond %{HTTP_USER_AGENT} JetCar [OR] 
RewriteCond %{HTTP_USER_AGENT} JOC\ Web\ Spider [OR] 
RewriteCond %{HTTP_USER_AGENT} larbin [OR] 
RewriteCond %{HTTP_USER_AGENT} LeechFTP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^LinkWalker [OR] 
RewriteCond %{HTTP_USER_AGENT} Mass\ Downloader [OR] 
RewriteCond %{HTTP_USER_AGENT} MIDown\ tool [OR] 
RewriteCond %{HTTP_USER_AGENT} Mister\ PiX [OR] 
RewriteCond %{HTTP_USER_AGENT} Navroad [OR] 
RewriteCond %{HTTP_USER_AGENT} NearSite [OR] 
RewriteCond %{HTTP_USER_AGENT} NetAnts [OR] 
RewriteCond %{HTTP_USER_AGENT} NetSpider [OR] 
RewriteCond %{HTTP_USER_AGENT} Net\ Vampire [OR] 
RewriteCond %{HTTP_USER_AGENT} NetZIP [OR] 
RewriteCond %{HTTP_USER_AGENT} Octopus [OR] 
RewriteCond %{HTTP_USER_AGENT} Offline\ Explorer [OR] 
RewriteCond %{HTTP_USER_AGENT} Offline\ Navigator [OR] 
RewriteCond %{HTTP_USER_AGENT} PageGrabber [OR] 
RewriteCond %{HTTP_USER_AGENT} Papa\ Foto [OR] 
RewriteCond %{HTTP_USER_AGENT} pcBrowser [OR] 
RewriteCond %{HTTP_USER_AGENT} PhpDig [OR] 
RewriteCond %{HTTP_USER_AGENT} QuepasaCreep [OR] 
RewriteCond %{HTTP_USER_AGENT} RealDownload [OR] 
RewriteCond %{HTTP_USER_AGENT} ReGet [OR] 
RewriteCond %{HTTP_USER_AGENT} Siphon [OR] 
RewriteCond %{HTTP_USER_AGENT} SiteSnagger [OR] 
RewriteCond %{HTTP_USER_AGENT} SmartDownload [OR] 
RewriteCond %{HTTP_USER_AGENT} SuperBot [OR] 
RewriteCond %{HTTP_USER_AGENT} SuperHTTP [OR] 
RewriteCond %{HTTP_USER_AGENT} Surfbot [OR] 
RewriteCond %{HTTP_USER_AGENT} tAkeOut [OR] 
RewriteCond %{HTTP_USER_AGENT} Teleport\ Pro [OR] 
RewriteCond %{HTTP_USER_AGENT} ^TurnitinBot [OR] 
RewriteCond %{HTTP_USER_AGENT} VoidEYE [OR] 
RewriteCond %{HTTP_USER_AGENT} Web\ Image\ Collector [OR] 
RewriteCond %{HTTP_USER_AGENT} Web\ Sucker [OR] 
RewriteCond %{HTTP_USER_AGENT} WebAuto [OR] 
RewriteCond %{HTTP_USER_AGENT} WebCopier [OR] 
RewriteCond %{HTTP_USER_AGENT} WebFetch [OR] 
RewriteCond %{HTTP_USER_AGENT} WebReaper [OR] 
RewriteCond %{HTTP_USER_AGENT} WebSauger [OR] 
RewriteCond %{HTTP_USER_AGENT} Website\ eXtractor [OR] 
RewriteCond %{HTTP_USER_AGENT} WebStripper [OR] 
RewriteCond %{HTTP_USER_AGENT} WebWhacker [OR] 
RewriteCond %{HTTP_USER_AGENT} WebZIP [OR] 
RewriteCond %{HTTP_USER_AGENT} Wget [OR] 
RewriteCond %{HTTP_USER_AGENT} Widow [OR] 
RewriteCond %{HTTP_USER_AGENT} Xaldon\ WebSpider [OR] 
RewriteCond %{HTTP_USER_AGENT} Zeus 
RewriteRule .* - [F,L]

bien sûr c'est à adapter selon tes besoins.
il y a sûrement moyen d'être plus rapide, surtout si tu veux être aussi strict que ce que tu dis...
c'était qui ces robots ?
 
WRInaute discret
hostname = sp9.amenworld.com ( 217.174.192.234 ) | browser : PHP/4.2.3 (3000 pages visitées ce soir)

et


hostname = ns1.superkdo.com ( 213.186.39.19 ) | browser : (15 000 pages visitées ; crawl en cours...)


Je sens que je vais depasser les 30000 hits encore une fois.
help :cry:
 
Olivier Duffez (admin)
Membre du personnel
essaie
Code:
RewriteCond %{REMOTE_ADDR} ^217\.174\.192\.234 $ [OR] 
RewriteCond %{REMOTE_ADDR} ^213\.186\.39\.19 $ 
RewriteRule .* - [F,L]
 
WRInaute impliqué
Dis moi, r23o, comment arrives-tu à voir tes logs d'aujourd'hui ?
Ou même d'hier... ou d'avant-hier...
Puisque les logs d'OVH sont HS depuis quelques jours.

(A moins que tu aies un script sur chaque page, j'aimerais savoir comment tu as fait)

Remi
 
WRInaute discret
ça a marché merci webrankinfo.

Mais deux nouveaux robots font deja pareil :

hostname : ensim.nethost.ch ( 207.44.172.12 ) | browser : PHP/4.2.2 (3000 visites depuis ce matin)

hostname : ensim.nethost.ch ( 207.44.172.12 ) | browser : PHP/4.2.2 (200 visites)

Je ne pense pas que ce soit une bonne idée de faire des resctricitons par ip, on ne s'en sortirait jamais. Est ce possible par hostname, ou par browser ?

Sinon je crois que tu comprends mieux pkoi je voulais être aussi restrictif...

Merci pour ton aide en tout cas.
 
WRInaute accro
chez moi j'ai un script anti aspi...

en gros, j'ai un lien invisible quelque part et comme l'aspirateur est le seul qui le suivra betement, boum, ip de l'indélicat automatiquement bloqué !

evidemment, y a une table des exceptions ;-)
 
Discussions similaires
Haut