Disable hotlinking generator
* note - this will not work on a windows system
Hotlinking is where someone else puts a link to your images or files from their website. In the case of images, this loads the image on their website which increases your bandwidth which you will ultimately pay for.
You can stop this from happening by placing a '.htaccess' file in the folder where your images are stored. This will only allow requests from your own pages to display the images - anyone linking to them from outside of your website, or any website you choose, will have the 'red x' instead of the image.
Alternatively, you can set the code to block particular referrers - so do not allow certain domains to hotlink your images or files.
Use the following form to create the code to place into your htaccess file to stop people hotlinking your images/files. The code uses mod_rewrite.
- Enter the urls which you want to allow to link to your images/files. This would normally be the site where the images are stored, however you may have several websites which you would like to allow to use your images.
- If you put the htaccess file in the domain root folder, ie http://www.yourdomain.com, this will affect every folder under it.
- If you have subdomains that link to the images, you will need to add the subdomains in the list.
- When someone hotlinks your files, you can have the link redirect to a page of your choosing. The front page of your site is a good idea! Enter the url you wish links to be redirected to.
- Enter the file extensions you wish to block hotlinking on. Use lowercase, and seperate each one by a space.
- Copy the generated code and paste it into notepad and save it as htaccess.txt. Upload it in ASCII format to the folder your images/files that you want to block are stored in and rename it to .htaccess (remember the dot!!)
- Unless you have your ftp program set to show invisible files, the file will then disappear from sight. Don't worry, it's still there!
- If you have an existing htaccess file, copy and paste the generated code into that.
- Note: only enter the base domain, without the protocol (http://) and without the www.
- Note: if you are blocking all traffic except yours and your website uses a dedicated IP, also enter the IP address i.e.: 123.123.123.123 otherwise anyone accessing your domain through the IP won't be able to see the images