Go to content Go to navigation

SmooveNET

SmooveNET

HowTo: Prevent Image Hot-linking

If your site host a lot of images, it is best that you prevent other people from directly linking to them on their site. Otherwise, your bandwidth allowance is used up, wasting valuable bandwidth.

Article continues below

Create an “.htaccess” file in your public_html directory with the following code:
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com.*$ [NC] RewriteRule .(gif|jpg|jpeg|bmp|png)$ - [F]

Where domain.com is your site’s domain name.

Posted by Chris Erice on 26 June 2006

Comments

Add your comment


Hidden


Textile Help

Preview Comment then Submit.