• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

anti leech using htaccess

megacool

New Member
I have a website where i am hosting some huge audio/video files.. which some lamers keep linking to eating my bandwidth.. I am using a PHP script to categorize the downloads.. but I need a way to protect say my downloads directory..so that it will only let a person download if they are coming from my domain.. i think there is a way to do it thru .htaccess .. any ideas?
 
Try:

RewriteEngine on
RewriteBase /download-directory
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC]
RewriteRule ^.*\.zip$ - [F]
 
Back
Top