Prevent hotlinking of images from .htaccess

Preventing Images Hotlinking on a Web Site

Bandwidth theft or hotlinking is a direct linking to web site’s files (images, video, etc.). It can be prevented with the mod_rewrite module.

Place rules like below into the .htaccess files for the domain (for example

 RewriteEngine on
RewriteCond % !^$
RewriteCond % !^http://(www\.)?example\.com(/)?.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|swf)$ – [NC,F] 


Both comments and pings are currently closed.

Comments are closed.