Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Complete Hotlink Protection Details »
Complete Hotlink Protection
Mod Version: 1.00, by naveeid (Coder) naveeid is offline
Developer Last Online: Apr 2019 I like it Show Printable Version Email this Page

vB Version: 4.x.x Rating: (3 votes - 5.00 average) Installs: 20
Released: 26 Apr 2011 Last Update: Never Downloads: 0
Not Supported Re-usable Code Translations  

Title : Complete Hotlink Protection

Version : 1.1

Coder : naveeid
Purpose : Prevent your forum attachments from being directly linked to - prevent bandwidth abuse.

Why : My dedicated server was down due to too many hotlinked image connections. i was feeling helpless. even after protecting images through .htaccess, images were still hot linked through attachment.php



How : just edit your server .htaccess and modify the code with your domain names



Installation :
edit your .htaccess file.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


1) please change yourfirstwebsite.com and yoursecondwebsite.com to your websites on that cpanel account. if you dont have a second website then you can remove that line

2) i am allowing google to fetch images or attachments for their server. if you dont want to allow google then just remove that line.

3) replace anypic.jpg with your website banner or hotlink warning banner.

it works very fine. its the simplest and easiest available soloution.

Demo:-
i have installed it on my website , you can check my website for hotlink protection.
http://www.nidokidos.org/attachment....3&d=1302073196
now this image will show in my website , this image will be displayed if opened it in a browser. but if it will be opened in any other website , it will be replaced by my website banner.

Download Now

Only licensed members can download files, Click Here for more information.

Supporters / CoAuthors

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Mini Mods YBMF-Hotlink Image protection TimberFloorAu vBulletin 4.x Template Modifications 8 03 May 2011 16:15

  #16  
Old 06 May 2011, 05:14
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
@boofo
first of all this code is nothing to do with guests. this code is only to stop other sites from hotlinking images from vbulletin forum. as all the images are served through attachment.php in vbulletin , so we need to protect our attachment.php abuse.

if any other website or forum will place any images from my website , for example this image url
http://www.nidokidos.org/attachment....3&d=1304560281

which is serving image through attachment.php , using this code in htaccess will not let the images of your site being displayed on the other website , but it will replace your website banner.

so in a result they will remove your images from their website. the code is working perfectly fine with me.
Reply With Quote
  #17  
Old 06 May 2011, 05:15
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
Originally Posted by MissKalunji View Post
what if my attachement.php

is under a different folder?


it does not matter if the attachment.php is under any other folder.. it will work fine.
Reply With Quote
  #18  
Old 06 May 2011, 05:17
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
Originally Posted by MissKalunji View Post
and if the image isn't available....

What will it show?

the standard vb error message?

which image you are talking about , please explain your question so that i can give you the right answer.
Reply With Quote
  #19  
Old 06 May 2011, 05:20
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
Smile

Originally Posted by billstelling View Post
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

is that correct?

opps put the wordpress in the wrong spot.. fixed

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


you have not placed any image at anypic.jpg????? please check that.

Last edited by BirdOPrey5; 12 Sep 2011 at 00:55. Reason: put code in code box
Reply With Quote
  #20  
Old 06 May 2011, 13:49
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by naveeid View Post
@boofo
first of all this code is nothing to do with guests. this code is only to stop other sites from hotlinking images from vbulletin forum. as all the images are served through attachment.php in vbulletin , so we need to protect our attachment.php abuse.

if any other website or forum will place any images from my website , for example this image url
http://www.nidokidos.org/attachment....3&d=1304560281

which is serving image through attachment.php , using this code in htaccess will not let the images of your site being displayed on the other website , but it will replace your website banner.

so in a result they will remove your images from their website. the code is working perfectly fine with me.
What do you think vb considers someone who isn't logged in, no matter where they are? I'm saying they attachment.php code doesn't need to be there as you have to be logged in to be able to download and see attachments, anyway. Thus, redundant code.
Reply With Quote
  #21  
Old 07 May 2011, 17:25
billstelling's Avatar
billstelling billstelling is offline
 
Join Date: Apr 2011
Originally Posted by naveeid View Post
you have not placed any image at anypic.jpg????? please check that.
yea i did.. i just named the pic that..
Reply With Quote
  #22  
Old 09 May 2011, 05:21
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
Originally Posted by Boofo View Post
What do you think vb considers someone who isn't logged in, no matter where they are? I'm saying they attachment.php code doesn't need to be there as you have to be logged in to be able to download and see attachments, anyway. Thus, redundant code.

if some one is not logging in but visits our website , he is a guest member. you can control guest permissions from the admin panel.

but if some one uses my website resources , hotlink my images in emails , sent it to large yahoo groups , place my website hotlinked images in forums , there is no option in VB4 to control that kind of hotlinking. and there was no modification available to stop the abuse of attachment.php. in this mod you can stop this kind of hotlinking. and save your server resources.
Reply With Quote
  #23  
Old 09 May 2011, 05:22
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
Originally Posted by billstelling View Post
yea i did.. i just named the pic that..
so i hope its working fine ?
Reply With Quote
  #24  
Old 09 May 2011, 08:01
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by naveeid View Post
if some one is not logging in but visits our website , he is a guest member. you can control guest permissions from the admin panel.

but if some one uses my website resources , hotlink my images in emails , sent it to large yahoo groups , place my website hotlinked images in forums , there is no option in VB4 to control that kind of hotlinking. and there was no modification available to stop the abuse of attachment.php. in this mod you can stop this kind of hotlinking. and save your server resources.
Well, you are wrong. I just tested in on the com with an attachment.php link from my site. If I was logged into my site at the same time, then, yes, the link would show the actual attachment. But if I was logged out of my site and clicked on the link that I posted on the com, it showed the registration error page from my site when I clicked on that link. So, your attachment.php code is ONLY good if the person is also logged into the site they are using it from, or if you allow guests to view and download attachments.

If you have the replacement image for the hotlinking on your site, the resources should be the same on your server as it still has to retrieve the image from your server.
Reply With Quote
  #25  
Old 03 Jun 2011, 05:52
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
Thumbs up

boofo may be i am unable to explain my point of view correctly to you..

let me explain it again.

1) first of all this mods stops simple hotlinking. and if some one hotlinks your images , it replaces it with your website banner or warning message.

2) secondly if my website images are placed and hotlinked using attachment.php then if will not show the original image but it will show website banner or warning message.

for example this is an image hosted on my website.
http://www.nidokidos.org/attachment....1&d=1298731742

a- if you will try to open it as its , it will be replaced by nidokidos banner.
a- if you will see it in google images , it will work fine.
b- if anyone , guest or member will see this image on nidokidos website pages , it will work fine.
for example see this image posted on this page.
but

if it is hotlinked in "any other" website , it will show a banner or warning message.

now see a website has placed it on it page , (may be using bing) , and as i have not allowed that website or bing to show my image on their web pages , they are getting a banner from my webserver.

please see this link
http://connect.in.com/nidokidos-org/...527553176.html


this is for what i made this mod. i hope you understand it now.
it has nothing to do with registrations , / members / guest.

Last edited by naveeid; 03 Jun 2011 at 05:59.
Reply With Quote
  #26  
Old 22 Jul 2011, 02:28
donal donal is offline
 
Join Date: Oct 2005
Where this file should actually be placed. Suppose I have www.mysite.com as domain and www.mysite/forum as forum root.

Should I place it in domain or in forum root directory?
Reply With Quote
  #27  
Old 31 Jul 2011, 07:48
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
you have to add it in your /forum directory.
Reply With Quote
  #28  
Old 31 Jul 2011, 07:53
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
I added it to the root and it works fine from there for me.
Reply With Quote
  #29  
Old 26 Apr 2012, 18:46
naveeid's Avatar
naveeid naveeid is offline
 
Join Date: Jan 2011
ok good.
Reply With Quote
  #30  
Old 23 Oct 2012, 17:34
viper357's Avatar
viper357 viper357 is offline
 
Join Date: Dec 2006
Does this work in vb3? I've put this at the bottom of my htaccess file but it doesn't seem to work, can someone check it for me please? My website is in my signature. Thanks.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Marine Aquariums
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 03:29.

Layout Options | Width: Wide Color: