No image hotlinking - can't get it to work

Status
Not open for further replies.

Cyberbob

Active Member
114
2010
6
20
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:

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mywebsite.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://external_image_to_show_instead [NC,R,L]

I tried to open a support ticket to KnownSRV but all i got was:
Code looks ok. However, I'm not sure why it doesn't work for you.
:facepalm:

So, i'll need your help here xD
 
13 comments
Try and change the part where it says mywebsite.com to your domain? and external_image_to_show_instead to the url of the image u wanna show instead.
 
I tried on my blog and it didn't prevent anything, imma try and look for another code, if you found a working one, post it here :).
 
@Lock Down, i wanted this to work, but still nothing. :(
At .htaccess file there is also some code from wordpress:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I tried to put every code at both above and beyond wordpress code but it didn't work.
 
Then I would ask them why neither .htaccess code doesn't work?
They may have something setup to block it.

PS send them both ..htaccess codes in your support ticket.
 
Status
Not open for further replies.
Back
Top