Whenever you want to ban/prevent hotlinking your media files and protect your server’s resources and bandwidth you may use the following snippet in the .htaccess file of your main directory of your site.
1 2 3 4 5 6 7 8 |
# BEGIN Hotlinking Protection RewriteEngine On RewriteBase / RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?<strong>YOURSITE.YOURDOMAIN</strong> [NC] RewriteRule .(webm|3g2|3gp|3gpp|flv|m3a|m4a|m4b|mka|mkv|mov|mp2|mp3|mp4|mpeg|swf|wav|wma|wmv|<strong>XYZ</strong>)$ - [NC,F,L] # END Hotlinking Protection |
Just replace YOURSITE.YOURDOMAIN with your site and at the fourth row of the actual code (don’t mind the # comment line) …