I have a fairly extensive video page on one of my sites. Naturally, i don't like direct linking to videos from other sites, but in the past i haven't cared. lately it's been more and more bandwidth that been eaten up by direct downloads from other sites... How can i prevent it? I imagine there are many ways to do this, from embedding the files, to some kind of referrer block or something, but i really don't know anything about it. what's my simplest, best bet?
In .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_REFERER} !^[url]http://([/url][^/]+\.)?yoursite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(avi|mpg|mpeg|wmv)$ getlost.jpg [L] </IfModule> Code (markup): There's more information about stopping hotlinking in this article that I wrote. Although it's about images, it can be applied to any file type. There's also a php script in there that could be modified to handle other file types and send an email alert every time anyone tries hotlinking a file.