Link Protection not working

Link Protection not working

Posted by: cranrazz
Posted on: 2006-03-13 16:19:00

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]



Re: Link Protection not working

Posted by: norm1037
Posted on: 2006-03-13 16:27:00

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......

Re: Link Protection not working

Posted by: cranrazz
Posted on: 2006-03-13 18:10:00

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

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

> Give it a good 10 minutes to let it work.

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?

Re: Link Protection not working

Posted by: norm1037
Posted on: 2006-03-14 02:48:00

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.


Re: Link Protection not working

Posted by: sarawalliams
Posted on: 2006-03-14 04:23:00

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.

Tags: jpeg bmpjpg jpeggif jpghtaccess filelink protectionimagesmydomaindreamhostgallery directoryhotlinkhotlinkingpnguploadedhttp