PDA

View Full Version : Hotlinker


Picplace
2003-04-04, 11:59 AM
Well, I hate hotlinkers, especially when it's my bandwidth.

Of course ew all should have hotlinking blocked, but I know many of us don't for various reasons. So with that, be careful of whitegirl.com blackgirl.com and I'm sure others. I'm showing an IP in my logs for their message boards.

http://66.154.81.226/ubbthreads/ubbthreads.php?Cat=&C=1

Might want to browse around and see if they're hotlinking any of your domains.

If you don't know the .htaccess to stop them here it is:

###STOP HOT LINKERS - BEGIN
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://YOURDOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YOURDOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://XXX.XXX.XXX.XXX/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://YOURDOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.YOURDOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://XXX.XXX.XXX.XXX/.*$ [NC]
RewriteRule .*\.(bmp|gif|GIF|jpg|JPG|exe|zip|mpeg|avi|mpg|wmv)$
###STOP HOT LINKERS - END

Obviously you need to change the XXX.XXX.XXX.XXX to your IP

JanTM
2003-04-04, 02:29 PM
Admitting that I'm not a htaccess expert... but will these lines of code added to my htaccess stop hotlinking when it is my entire html page that is just loaded into a seperate frame on some board??

Picplace
2003-04-04, 02:35 PM
no it won't. I don't think there is really a way to do that unless you block that entire domain from refering to you...

it will only deal with the file formats listed:

bmp|gif|GIF|jpg|JPG|exe|zip|mpeg|avi|mpg|wmv

JanTM
2003-04-04, 03:09 PM
But all my galleries and free sites have thumbs linked directly to the pictures... so they can load my entire page into a frame... but when they click the thumb to go to the big pics they get slammed by the htaccess... right?
In that case I can use this from right about now :D

Picplace
2003-04-04, 06:09 PM
no htaccess wouldn't help that at all...

the htaccess that I posted will only help people who try to pull your image off of your server from their web page...

so if for example on this domain i wanted to hotlink the smiles...

so if on my domain i linked like this: <img src="http://www.greenguysboard.com/board/images/smilies/redface.gif>

it will not help with frames, try setting all the links in your gallery to _top

with the htaccess that would show up as a broken image on my site. You can also ad another line of code that an alternate image is displayed. I like mean ones that say things like, "This website steals it's images!"

DangerDave
2003-04-04, 06:49 PM
Personally, I have never understood why peeps only block certain files types?

Is it OK for the hotlinker to link to some things , but not others. :confused:

Toss them all!!! :bfg:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://([a-z0-9-]+\.)*fukyou.com(:80)* [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://([a-z0-9-]+\.)*spammer.com(:80)* [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://([a-z0-9-]+\.)*hotlinker.com(:80)* [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://([a-z0-9-]+\.)*eatme.com(:80)* [NC]
RewriteRule /* http://www.tossthemsomwhere.com/ [R,L]

This is NOT a general htaccess file, it is purpose built to stop specific hotlinkers..

Picplace,

RewriteRule .*\.(bmp|gif|GIF|jpg|JPG|exe|zip|mpeg|avi|mpg|wmv)$

This line will NOT stop them linking directly to WMV files. No referer is sent by WMP.

DD

Cleo
2003-04-04, 06:51 PM
The htaccess example that Picplace posted is a good one. What makes it very good is the fact that it uses full URL and not wildcards to shorten the code. I've seen a lot of examples that do use wildcardsin the code and it is easy to bypass the code then.

Here is a little page that I maintain that has additional htaccess info plus some other goodies,
http://www.cleos-porn-links.com/adult-links/webmaster-help.html

JanTM
If they load your page in a frame it is still going to have your sponsor codes on it so enjoy, lol.

Cleo
2003-04-04, 06:58 PM
DangerDave
First you have to catch them before you can block them so that is why most of us set up a htaccess file that only blocks hotlinking certain file types. :banghead:

Here is a nice URL for checking if your htaccess file is working, http://hotlinking.com/