Un htaccess pour les pompeurs de sites

De manière globale en retournant un accès interdit

SetEnvIfNoCase Referer "^http://notes.depad.fr/" local_ref=1
Order Allow,Deny
Allow from env=local_ref

Ou de manière plus subtile en y mettant plusieurs conditions

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?notes.depad.fr(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?google.(fr|de|com|ca)(/)?.*$ [NC]
RewriteRule .*.(gif|png|jpg|jpeg|pdf|doc|wav|bmp|avi|mpg|mpeg|mp3|zip|rar)$ /nohotlink.png [R,NC]

Si vous avez mis en place un cache Varnish en amont, consulter cet article : Protection contre le hotlinking avec Varnish


Suggestions de lecture :

comments powered by Disqus