Topic: Hotlink protection

I see on the script it has a full size image link (which I'm disabling from showing that on the page)

But I want to add hotlink protection with an image saying please visit the main page, please do not hotlink fullsize images.


Because I want the users to visit my page so the advertising banners and offers that are on the pages show up.


has someone scripted there own hot linking protection? or should I just script it?


thanks.

Mark.

Thumbs up

Re: Hotlink protection

Check this http://www.htaccesstools.com/hotlink-protection/

rodolfoberrios.com | PLEASE use Tech Support forums to ask for support!

Re: Hotlink protection

thanks for the quick reply. I will take a look now.

Thumbs up

Re: Hotlink protection

I tried it out, but it seems to not work correctly. I think its because of the existing data in my .htaccess there..

what is the structure of the way the generated code should fit in?

it generated this for me...

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?myothersiteiwantallowed.com [NC]

RewriteRule \.(jpg|jpeg|png|gif)$ http://www.mysite.com/content/themes/mysitetheme/theme-img/hotlink.gif [NC,R,L]

Last edited by mnewbegin (2011-10-18 17:20:52)

Thumbs up

Re: Hotlink protection

try to check it with another browser... The browser save the image on cache.

rodolfoberrios.com | PLEASE use Tech Support forums to ask for support!

Re: Hotlink protection

mnewbegin wrote:

I tried it out, but it seems to not work correctly. I think its because of the existing data in my .htaccess there..

what is the structure of the way the generated code should fit in?

it generated this for me...

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?myothersiteiwantallowed.com [NC]

RewriteRule \.(jpg|jpeg|png|gif)$ http://www.mysite.com/content/themes/mysitetheme/theme-img/hotlink.gif [NC,R,L]

Wouldn't this just block all hot linking, is there a way to only block the big image and allow the thumbnails?

Maybe we can make the thumbnails PNG and only allow hotlinking to PNG files?

hmmm  smile

Thumbs up

Re: Hotlink protection

Remember to use [NC, OR] on all the RewriteCond except on the last one when you have to put just [NC]

rodolfoberrios.com | PLEASE use Tech Support forums to ask for support!

Re: Hotlink protection

Rodolfo wrote:

Remember to use [NC, OR] on all the RewriteCond except on the last one when you have to put just [NC]

Thanks you answered this in this thread: http://chevereto.com/forums/post8665.html#p8665

I just disabled rewrite in the thumbnail folder.

Thumbs up