You are here: Blog
Tutorial: How To Stop Bandwidth Thieves On Your Website« UK Postcode Data To Be Free In 2010 Is Broadband In The UK Really THAT Bad? » If when you examine your website stats you notice a lot of hits for certain images, chances are some people are displaying your images on their own websites – be it deliberately, or perhaps on a forum. This practice is known as hotlinking and the people that do it are what we would simply call bandwidth thieves. In either case this increases the bandwidth usage of your website so if your host does not provide you with unlimited monthly bandwidth then you may have to pay extra bandwidth fees to them. So, to stop this unauthorised use of your website’s images you can create a file called .htaccess using your favourite text editor. In this file, copy and paste the following text:
Note: make sure you replace the “mydomain\.com” with your own domain name – for example on the Gatt Design website that line would be:
Once you have done this, save your .htaccess file and upload it to your website’s document root directory – normally something like /public_html or /wwwroot – you will need to contact your web host if you are unsure! Now you can test that this works by trying to display one of your website’s images on another website external to your domain name or in a forum post on another domain name for example. You will know that this is successful because your web server will return a ‘503 forbidden’ error to the site that is trying to display the image and you will see no image displayed. If you want, you can instead display a “hotlinking forbidden” (or whatever you wish to tell bandwidth thieves) image in place of the one they tried to display. What you need to do is change the last line of the above block of code to:
Note: make sure you change the bold text to the correct path and file name to your image! Bear in mind that displaying an image in place of what the other website tried to show will still result in your bandwidth being used up by these other sites whereas the original method will not. This entry was posted on Sunday, December 13th, 2009 at 4:04 pm and is filed under Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed. |
Keep Up To Date! |