Complete Hotlink Protection
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.php?attachmentid=40703&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 No files for download. Supporters / CoAuthors
|
Similar Mods
Mini Mods YBMF-Hotlink Image protection | vBulletin 4.x Template Modifications |