You probably are using ngnix.

Try this:
valid_referers blocked www.mydomain.com mydomain.com;
if ($invalid_referer) {
rewrite ^/wp-content/uploads.*\.(gif|jpg|jpeg|png)$ http://www.mydomain.com/wp-content/banners/Banner3.jpg last
}
if(!-e){
rewrite ^(.*)$ /index.php last
}
or this for hotlinking all files.
location ~* (\.jpg|\.png|\.css)$ {
valid_referers blocked mydomain.com www.mydomain.com;
if ($invalid_referer) {
return 444;
}
}
Lock Down Reviewed by Lock Down on . No image hotlinking - can't get it to work Hi, i want to block image hotlinking from my website. I found instructions on how to do it and i edited the .htaccess file but it's not working. Here is what i added: RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mywebsite.com RewriteRule \.(jpg|jpeg|png|gif)$ http://external_image_to_show_instead I tried to open a support ticket to KnownSRV but all i got was: :facepalm: Rating: 5