The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Complete Hotlink Protection Details »» | |||||||||||||||||||||||||
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 RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yourfirstwebsite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursecondwebsite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+\.)?google\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://www.yourfirstwebsite/anypic.jpg [L] RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yourfirstwebsite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+\.)?google\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*attachment\.php*$ http://www.yourfirstwebsite/anypic.jpg [L,R,NC] 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. Supporters / CoAuthors Show Your Support
|
Благодарность от: | ||
madness85 |
Comments |
#32
|
||||
|
||||
It's blocking images on tapatalk, any idea how we can allow tapatalk?
|
#33
|
|||
|
|||
naveeid and Boofo. I'm from Brazil
My .HTACESS stayed that way Code:
RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(.+\.)?MYDOMAIN\.com\.br/.*$ [NC] RewriteRule \.(mid|wav|mp3|zip|avi|rm|ram|swf|mpg|wmv|pdf|jpeg|jpg|gif|bmp|png|psd|ipa|deb)$ http://www.MYDOMAIN.com.br/images/Xto4B.jpg [NC,R,L] 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 |
#34
|
||||
|
||||
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. |
#35
|
||||
|
||||
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. |
#36
|
||||
|
||||
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. |
#37
|
|||
|
|||
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... |
#38
|
||||
|
||||
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.
|
#39
|
||||
|
||||
I have seen you ask numerous times about the windows server, is there a particular reason you don't switch to a Linux server?
|
#40
|
|||
|
|||
works great thank you
|
#41
|
||||
|
||||
Thanks so much for this, just what I needed. I uploaded it to my forum directory as it wouldn't work in the root.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|