Link Protection not working


#1

I want to prevent hotlinking to my images in my gallery.
I enabled Link Protection from Dreamhost’s .htaccess panel but people can still hotlink to the images on my server.

So I made my own .htaccess file like below and uploaded to my gallery directory. Still, it’s not working. Could anyone help please?

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com(/)?.$ [NC]
RewriteRule .
.(gif|jpg|jpeg|bmp|png)$ - [F,NC]


#2

When you use the .htaccess / webdav option under Control Panel did you make sure you ticked the box in the bottom section?

Give it a good 10 minutes to let it work.

This is one of mine for comparison:-

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www.)?example.com/?.*$ [NC]
RewriteRule .(gif|jpg|jpeg|png|mp3|mpg|avi|mov)$ - [F,NC]

Little difference apart from the use of https…


Norm


#3

[quote]When you use the .htaccess / webdav option under Control Panel did you make sure you ticked the box in the bottom section?

[/quote]

Yes, I ticked the “Forbid linking to files in this dir?” box and the panel said “Link Protection - Yes”.

[quote]Give it a good 10 minutes to let it work.

[/quote]

I enabled the Link Protection about a month ago. I just noticed it’s not working.

I used the URL hotlink checker and my image can be hotlinked and displayed by an outside server.

Do I need to put a .htaccess file in all directories on my domain?


#4

If you haven’t already I would be inclined to delete the setting via the Control Panel and then after about 15 minutes redo it from scratch, wait at least 15 minutes (although as I write this it seems to be working within a minute or so) and see if that improves things.

If you select a folder in the Control Panel to hotlink prevent then it will hotlink prevent in that folder,and I believe below it.

If you do not select a folder but leave the box blank then it will hotlink prevent in the root domain folder and folders below i.e. the site.


Norm


#5

I think you need to just give it some time. I remember when I first started, my hotlinking protection wasn’t working either till the next day or something.