Archive for the tag 'Graphics'

Preventing Graphics 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 vhost.conf or .htaccess files for the domain (for example www.example.com):

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