To protect your image files not to be linked by other websites, which consume your web hosting account monthly traffic, you may consider to enable Hotlink Protection to deny external website direct HTTP request to your image files.

You can put a file called .htaccess onto your /public_html (or its subfolder)

The content of this file .htaccess –

Rewriteengine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://your_domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.your_domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.trusted.com/.*$ [NC]
RewriteRule .*\.(gif|GIF|jpg|JPG)$ – [F]

Of course, you replace the your_domain.com as your own domain name

Ref: http://www.webmasterstop.com/tutorials/prevent-hotlinking.shtml


 

To prevent hotlink from particular sites, e.g. myspace.com, blogspot.com and livejournal.com –

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?myspace\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal\.com/ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

Ref.: http://altlab.com/htaccess_tutorial.html

Pin It on Pinterest

Share This