by Hiroshi on December 31st, 2009
Protect hotlinking the right way. There are content stealers out there who will copy your links and images and display them at their websites in result of which you pay more for bandwidth. If you do not do it the right way, you can block google and feedburner also. Here is a code to do it the right way. Any incoming direct request for your image file, zip file or rar will will display your specified image instead of that.
Add this code into your .htaccess file and make sure you change ‘yoursitename’ there.
Options +FollowSymlinks
# Protect Hotlinking
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+.)?yoursitename.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?feedburner.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?feeds2.feedburner.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*.(jpe?g|gif|bmp|png|zip|rar)$ http://yoursitename.com/someimage.jpg [L]bandwidth, hotlinking, htaccess



[...] Protect Hotlink the Right Way Using htaccess – htaccess – PHP … By admin | category: free scripts, scripts | tags: downloads, hotlink-the-right, magic, [...]
thanks for this – happy holidays :D
happy new year – love your blog
this is an outstanding blog
the way u write is fabolous.
Thanks a lot