Greenguy's Board


Go Back   Greenguy's Board > Newbie Questions
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-02-03, 05:41 AM   #1
Mr. Blue
Searching for Jimmy Hoffa
 
Mr. Blue's Avatar
 
Join Date: Jan 2005
Location: Long Island, NY
Posts: 771
.htaccess & hotlinking pictures

I was just reading over my stats for yesterday and saw quite a few people leeching by directly hotlinking. Should I just block the domains of the leechers or is there a better way to prevent hotlinking?

I was going to use this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?http://www.allhiphop.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?http://www.siccness.net/.*$ [NC]
RewriteRule .* - [F,L]

I've never had to do this on my regular webpages so this is a little new to me. Any help would be appreciated.
Mr. Blue is offline   Reply With Quote
Old 2005-02-03, 06:04 AM   #2
Osiris
No offence Apu, but when they were handing out religions you must have been out taking a whizz
 
Osiris's Avatar
 
Join Date: Apr 2003
Location: New Orleans
Posts: 283
Send a message via ICQ to Osiris Send a message via Yahoo to Osiris
Check out this cool tool:
http://www.htaccesstools.com/hotlink-protection/

It will allow you to add domains that you will allow to hotlink from you, and block all others. For instance, if you want to allow yourself to link between your domains, add them into the Allowed Domains box.. it will allow you to hotlink from X domain to Y domain with no problem, but anyone else trying to hotlink will be blocked.
__________________
Osiris is offline   Reply With Quote
Old 2005-02-03, 07:19 AM   #3
Mr. Blue
Searching for Jimmy Hoffa
 
Mr. Blue's Avatar
 
Join Date: Jan 2005
Location: Long Island, NY
Posts: 771
Doesn't some tgps hotlink the thumbs? I think AskJolene does and I wouldn't want to block legit type traffic.

Need to figure this out because bandwidth is starting to become an issue, lol.
Mr. Blue is offline   Reply With Quote
Old 2005-02-03, 03:35 PM   #4
Smutferret
No matter how good you are at something, there's always about a million people better than you
 
Smutferret's Avatar
 
Join Date: Nov 2004
Location: MA, USA
Posts: 231
Send a message via ICQ to Smutferret
Hi Mr. Blue,

Here's a little something else to think about when using .htaccess files to protect images. If the person viewing your page (surfer or reviewer) happens to use firewall software that is set to strip the referrer field, all they will see on your page is broken images.

I'm not sure how big of a problem this is but stripping the HTTP_REFERRER field is a default setting in many firewall programs. It's used to help keep web sites from tracking your surfing habbits.

I use .htaccess files to protect my images from hotlinking and will continue to do so but it is food for thought.

As far as TGPs hotlinking thumbs, I know some TGP scripts d/l a copy of one of your thumbs (or ask you to u/l one) and crop it to size to use as a link to your gallery. I'm not sure if .htaccess would cause a problem there but I can see how it could.

Regards,
SF
Smutferret is offline   Reply With Quote
Old 2005-02-14, 07:43 PM   #5
BlueQuartz
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
 
BlueQuartz's Avatar
 
Join Date: Jun 2004
Posts: 175
have you sorted this out yet?

best way is to drop a htacess in your root and allow requests from your domain only

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com [NC]
RewriteCond %{HTTP_REFERER} !^http://your-ip [NC]
RewriteRule [^/]+\.(exe|mpeg|mpg|avi|mp3|gif|jpg|JPG|GIF|MP3|AVI|JS|js)$ - [F]
RewriteRule ^/cgi-bin/.+$ - [F]
AddHandler server-parsed html
ErrorDocument 404 http://www.yourdomain.com/404.htm
BlueQuartz is offline   Reply With Quote
Old 2005-02-15, 01:37 PM   #6
Mr. Blue
Searching for Jimmy Hoffa
 
Mr. Blue's Avatar
 
Join Date: Jan 2005
Location: Long Island, NY
Posts: 771
Actually I have sorted it...I hadn't realized just how much you could do with htaccess

I'm glad I sorted it out a week ago...someone decided to fusker me recently and it would have cost a pretty penny in bandwidth if I didn't have this in place, lol.
Mr. Blue is offline   Reply With Quote
Old 2005-02-15, 02:56 PM   #7
BlueQuartz
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
 
BlueQuartz's Avatar
 
Join Date: Jun 2004
Posts: 175
Quote:
Originally Posted by Mr. Blue
Actually I have sorted it...I hadn't realized just how much you could do with htaccess

I'm glad I sorted it out a week ago...someone decided to fusker me recently and it would have cost a pretty penny in bandwidth if I didn't have this in place, lol.

ok thats awesome man - all the best
BlueQuartz is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:58 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc