![]() |
Complete Hotlink Protection
1 Attachment(s)
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. Code:
RewriteEngine on 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. |
Code removed
|
well if a server is already overloaded , then it should not allow any directory to be hotlinked.
|
You don't have to put anything in to that directory if you don't want to. It just allows you to if ever needed.
And your Google code is redundant as this takes care of it already: Code:
RewriteCond %{HTTP_REFERER} !^$ |
Quote:
|
Do you allow guests to download attachments?
|
well in my forum guests are allowed to download attachments and view attached images.
|
through this mod , if any picture will be embedded/hotlinked through attachment.php on any OTHER website , it will display website banner or warning picture instead. similarly any other mp3 or download links of your forum files will be placed on any OTHER website , they will show your website banner or bandwidth theft warning when clicked.
|
No problem. I have removed my code.
|
Where should this go? in forum? or root?
|
Root.
|
and if the image isn't available....
What will it show? the standard vb error message? |
what if my attachement.php
is under a different folder? |
Code:
RewriteEngine on opps put the wordpress in the wrong spot.. fixed RewriteCond %{HTTP_REFERER} !^http://(.+\.)?thewindowscenter.wordpress\.com/ [NC] |
naveeid, your attachment.php line does not work. I set guests to be able to download/view attachments, and this did not stop anyone from another site being able to hotlink it. When I set guests back to not be able to view or download attachments, then they got the login screen on a hotlink. But they got that anyway before the attachment.php line was added to the htaccess. So that code is redundant.
|
@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. |
Quote:
it does not matter if the attachment.php is under any other folder.. it will work fine. |
Quote:
which image you are talking about , please explain your question so that i can give you the right answer. |
Quote:
you have not placed any image at anypic.jpg????? please check that. |
Quote:
|
Quote:
|
Quote:
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. |
Quote:
|
Quote:
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. ;) |
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. |
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? |
you have to add it in your /forum directory.
|
I added it to the root and it works fine from there for me.
|
ok good.
|
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.
Code:
RewriteEngine on |
It's blocking images on tapatalk, any idea how we can allow tapatalk?
|
naveeid and Boofo. I'm from Brazil
My .HTACESS stayed that way Code:
RewriteCond %{HTTP_REFERER} !^$ I have a doubt. The image that will be replaced in the hotlink, should be the same as the image copies from within my domain ? The image that will be replaced in the hotlink is warped. Eg: The original image is 200px x 400px. My hotlink picture. Should measure 200 x 400 too? Or should lower? The problem that my images vary in height and width. Is there any way to set it somewhere or file? The hotlink img is here: The test only is here |
Quote:
brother you can not control this. because the image we replace with hotlinked image is different sizes. i think its not important , we can ignore this. |
Quote:
i cant say anything about vb3 , if the same attachment.php type of thing is there in vb3 , then i think it will work out. |
Quote:
to allow any webiste , just add this code below the google line RewriteCond %{HTTP_REFERER} !^http://(.+\.)?google\.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+\.)?YESTOTHISWEBSITE\.com/ [NC] replace YESTOTHISWEBSITE with the name of the website which you want to allow for hotlink. |
What if i have vBSEO installed? Seems like it's not working for me (as it's rewriting the url to make it friendly - therefore it doesn't have the attachment.php inside). Let's do a test:
I will use an IMG for this: Code:
http://www.consolegames.ro/forum/attachments/f7-console-news/198081d1371497600-cum-se-descurca-last-us-la-capitolul-vanzari-the_last_of_us.jpg?cmps=1 See? It's still showing... although i've added the .htaccess lines... |
Does anyone have the web.config version of this? I am using iis 7 (windows server 2008R2), and as you know, windows uses web.config, not htaccess.
|
I have seen you ask numerous times about the windows server, is there a particular reason you don't switch to a Linux server?
|
works great thank you
|
Thanks so much for this, just what I needed. I uploaded it to my forum directory as it wouldn't work in the root.
|
All times are GMT. The time now is 06:16 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|