Sunday, October 23, 2005

Prevent "Hotlinking" or Bandwidth Theft

Hotlinking is direct linking to a remote website's files (images, video's, streaming files etc.). An example would be using an tag to display a jpg image you found on someone else's web page so it will appear on your own website, blog, or forum post. How do you know you are being hotlinked? Possibly if you are receiving domain over limit messages from us. However it's worth keeping a regular eye on your webstats and checking the referrer links. Bandwidth more accurately refers to the data transferred from a website to a user's computer and is usually measured by web hosts in Gigabytes (or GB). For example 100GB per month of Data Transfer. When you view a webpage, you are using that site's data transfer to display the files. Since web hosts charge based on the amount of data transferred. If a site goes over it's monthly bandwidth, it's either billed for the extra data transfer or suspended. How do you stop other sites directly linking to your images and media files and stealing your bandwidth? Simple. Open notepad (or similar text editor) and add the following and (this is important) save it as .htaccess (the dot before htaccess is important).

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?mywebsite.com(/)?.*$ [NC] RewriteRule .*\.(gif|jpg|jpeg|bmp|wmv)$ http://www.weycrest.co.uk/i/weycrest_dynamic.jpg [R,NC]
Obviously change `mywebsite.com` to the correct address of your website. You can also change redirection to an alternate (much smaller, and less bandwidth hungry) image. Then upload it your website using your favourite FTP program. If you do not feel sufficiently confident to carry this out contact the Weycrest Support Team and we will add it to your vhost.conf. To check if your hotlink protection measures are working or for more complex rewrite rules, here are a couple of links: http://www.htmlbasix.com/disablehotlinking.shtml

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home