How to block HotLinks from images with warning?

5

Soon I saw a site that was displaying an image hosted on another site, at least trying .. What happens is that the site that was linking the image of others came to appear a new image instead of the desired image. / p>

The new image consisted of a simple rectangle with the phrase indicating that the image was being "copied", noting the sources of the website clearly notice HotLink :

My site already has% blocking for HotLinks :

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?nome_do_meu_site.com.br [NC]

But how do I add this functionality mentioned?

    
asked by anonymous 09.02.2016 / 23:14

1 answer

4

Put this in your htaccess:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?meusite\.com\.br/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /imagem/anticopia.jpg [L]

After this, create an image with the desired text or whatever you want, and change that part of the code with the directory and image name

  

/images/anticopia.jpg

Also change, of course, "mysite.com"

I use this tool on my site and find it very useful.

    
09.02.2016 / 23:24