Empêcher le hotlinking d'image - Astuces CSS

Anonim
RewriteEngine On RewriteCond %(HTTP_REFERER) !^http://(.+\.)?yourdomain\.com/ (NC) RewriteCond %(HTTP_REFERER) !^$ RewriteRule .*\.(jpg.webp|gif|bmp.webp|png)$ /images/dontsteal.jpg.webp (L)

Les images liées à partir de n'importe où ailleurs que votre site Web sont redirigées vers un graphique personnalisé. Notez cependant que cela affecterait également les personnes lisant des messages via des lecteurs RSS.

Autoriser également les moteurs de recherche

RewriteCond %(HTTP_REFERER) !^http://(.+\.)?mydomain\.com/ (NC) RewriteCond %(HTTP_REFERER) !^http://(.+\.)?google\.(.+)/ (NC) RewriteCond %(HTTP_REFERER) !^http://(.+\.)?(.*\.)?google\.(.+)/ (NC) RewriteCond %(HTTP_REFERER) !^http://(.+\.)?bing\.(.+)/ (NC) RewriteCond %(HTTP_REFERER) !^http://(.+\.)?(.*\.)?bing\.(.+)/ (NC) RewriteCond %(HTTP_REFERER) !^http://(.+\.)?yahoo\.(.+)/ (NC) RewriteCond %(HTTP_REFERER) !^http://(.+\.)?(.*\.)?yahoo\.(.+)/ (NC) RewriteCond %(HTTP_REFERER) !^$ RewriteRule .*\.(jpe?g|gif|png)$ /transparent.gif (L)