Categories
How do I prevent hotlinking of my photos?
How do I prevent hotlinking of my photos?
By putting the following code in your .htaccess you prevent hotlinking:
RewriteEngine OnRewriteCond
%{HTTP_REFERER} !^https://(www.)?domainname.com [NC]
RewriteCond %{HTTP_REFER} !^$RewriteCond
%{HTTP_REFER} ^https://.*$RewriteRule
.(jpe?g|gif|bmp|png)$ /example/picture.gif [L]
For the web.config, you can use the following example: