Block hotlinking for large images ?
#1
Posted 14 May 2009 - 07:41 PM
Otherwise, is it possible to change the destination folder of the uploaded images so they end up in a different folder to the generated thumbnails, so I could use different htaccess files in each folder ?
I've asked this question elsewhere and it seems possible to do, but I can't get it to work.
#2
Posted 14 May 2009 - 09:59 PM
I've only worked sparingly with htaccess, so I may be wrong, but doesn't the statements execute in order? Meaning that the second one allowing the _thumb would override the first one.
Just a thought, haven't worked with .htaccess files in over a year, and only long enough to get my server working how I wanted it. So that could be horribly inefficient, or just plain incorrect. ~_~'
#4
Posted 14 May 2009 - 10:10 PM
I didn't handle setting up most of my server, but I recall having to use htaccess to correct virtual hosting issues. Someone i know is rather good with them, if you want to post the code I can send it his way and see if he can fix it.
#5
Posted 14 May 2009 - 11:20 PM
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
#allow hotlinking for thumbnails
RewriteCond %{REQUEST_URI} !_thumb
#allowed website to hotlink (don't forget to add your own site !!)
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com(/)?.*$ [NC]
#display no-hotlink.jpg instead of the requested image
RewriteRule \.(jpg|jpeg|gif|png|bmp|ico)$ http://www.domain.com/no-hotlink.jpg [NC,R,L]Replace domain.com with your domain name.
This post has been edited by Josh D.: 12 October 2009 - 08:26 PM
Support Topic Guidelines
#6
Posted 15 May 2009 - 02:26 AM
Order allow,deny
Deny from all
</Files>
ErrorDocument 404 /css/images/error404.gif
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^(www\.)?mydomain\.com [NC]
RewriteCond %{REQUEST_URI} !_thumb\.
RewriteRule \.(gif|jpg|jpeg|png)$ http://www.mydomain.com/css/images/errorhotlink.gif [R=301,L]
Unfortunately it was blocking large images on my own site as well ! Can anyone work out what I've done wrong ? (I did enter my actual domain name
This post has been edited by CasualNerd: 15 May 2009 - 02:27 AM
#8
Posted 17 May 2009 - 01:48 AM
I will, I just need to have some free time, last time I spent hours breaking and fixing things.
#9
Posted 17 May 2009 - 05:36 AM
RewriteCond %{HTTP_REFERER} !^$
#allow hotlinking for thumbnails
RewriteCond %{REQUEST_URI} !_thumb
#allowed website to hotlink (don't forget to add your own site !!)
RewriteCond %{HTTP_REFERER} !^http://(www\.)?4img.us(/)?.*$ [NC]
#display no-hotlink.jpg instead of the requested image
RewriteRule \.(jpg|jpeg|gif|png|bmp|ico)$ http://www.4img.us/no-hotlink.jpg [NC,R,L]
Please help.
#10
Posted 17 May 2009 - 04:11 PM

Image: http://www.hostmine....hvkq4k7bai1.jpg
This post has been edited by Josh D.: 21 April 2010 - 08:58 AM
Support Topic Guidelines
#11
Posted 23 May 2009 - 06:48 AM
It blocks some full images but not others, I can't work out why. It also blocks full images from being displayed in the image host viewer page, even though I excepted the domain in the appropriate spot.
I've looked for errors but I can't work it out at all.
#15
Posted 03 June 2009 - 01:44 AM
I'm trying to work out what I've done wrong...
no it works for me , first it wasn't work but when I delete cookies and cache and even change my ip and start with fresh browser it works like a charm
it doesn't block large images on your site , only on others sites
#18
Posted 10 June 2009 - 12:44 PM
HUGE amount of bandwidth wasted in the last 4 days : about 10-15 gb each day .. and I have only a few visitors a day.
I've tried Josh D solution of htacess mod, but even after this, in 10 hours, I've lost another 10 gb of bandwidth.
Questions:
1) How can I find what pictures are hotlinked?
2) How can I find what pictures are most visited ? (and consuming the most bandwidth) ?
#19
Posted 10 June 2009 - 12:46 PM
HUGE amount of bandwidth wasted in the last 4 days : about 10-15 gb each day .. and I have only a few visitors a day.
I've tried Josh D solution of htacess mod, but even after this, in 10 hours, I've lost another 10 gb of bandwidth.
Questions:
1) How can I find what pictures are hotlinked?
2) How can I find what pictures are most visited ? (and consuming the most bandwidth) ?
see the server logs via cPanel or DirectAdmin
it will show you who send lot of hits , most probably a Chinese forums they usually send huge amount of visitors
#20
Posted 10 June 2009 - 01:19 PM
it will show you who send lot of hits , most probably a Chinese forums they usually send huge amount of visitors
thanks mate.
yes, I see in cpanel, in awstats, at referrers, a LOT of hits (not visits) , from chinese forums. I have about 100 visitors a day, but over 100.000 hits from those forums daily,
Now, I will wait to see what wil happen after I modify the .htacess, and after I removed the direct link when uploading the pictures.

Sign In
Register
Help




MultiQuote