SBDavid
Nov 18th, 2009
Nov 18th, 2009
Preventing Graphics Hotlinking on a Web Site
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]
RewriteCond % !^$
RewriteCond % !^http://(www\.)?example\.com(/)?.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|swf)$ - [NC,F]