Some of my readers may know what is hotlinking and some have even never heard the word hotlinking. So in this article, I am going discuss all things about hotlinking. We will discuss, what hotlinking is, how it can affect your account and how you can block it.
What is Hotlinking?
Hotlinking is the process of linking a file directly using the web URL from other website. Although hotlinking can be used for many types of files, hotlinking is mostly used for images. If you understand this then it’s fine. If you haven’t understand it then don’t worry. We will take an example. That is the easy way to understand the hotlinking process.
To add the image in your website, you will normally use the following code.
<img src="images/image1.jpg" height="100" width="100">
In the above code, you can see that we are pointing src to the image1.jpg which is stored under images folder. Now suppose, some person comes to your site and she like the image. She wants to add the same image on her site. She have two options. 1) Download the image and host it on her server. 2) Directly link (hotlink) the image from your website.
Since most of the users are simply lazy, they will not use first option to integrate the image. In the first option, they will have to download image, upload to their server and add the code. That’s too much work. In second option, user just have to change the src parameter in img tag. This is how img tag will look after making changes.
<img src="www.yoursite.com/images/image1.jpg" height="100" width="100">
Why Do You Want to Stop Hotlinking?
The big disadvantage of hotlinking is that when someone visits the webpage from where your image is hotlinked, the image from your server will be downloaded. Every time the image is downloaded from your server, bandwidth from your hosting account is used. If you are on the limited bandwidth package then you will exceed the allotted bandwidth. You will have to pay more to the hosting provider. If higher hosting plan is not available with the hosting provider then they will simply suspend your account.
How to Block Hotlinking on DreamHost account?
If you want to stop the hotlinking from your website then you can do so on your DreamHost account. You need to follow these steps in order to stop the hotlinking from your website.
1) Login to DreamHost panel using your username and password.
2) Now click on Goodies section from the left side navigation panel. You will see more options. Click on Htaccess/WebDAV.
4) On this page, select the domain on which you want to stop the hotlinking. Then click on “Set Up A New Directory” button.
5) Enter the directory name for which you want to block the hotlinking.
6) Now check the checkbox which says, “Forbid linking to files in this dir?”
7) Enter the file extensions for which you want to block the hotlinking. You also have an option for whitelisting the domains. Enter the domain names for which you want to allow the hotlinking.
8) Finally, click on Configure This Directory button.
You will get an email from DreamHost when the setup is done.
How to Check Hotlinking Setup is Working or Not?
You should always keep a practice of checking the setup. Make sure that whatever setup you have done is working correctly.
To check the hotlinking setup, use hotlink checker. Visit hotlinking checker, enter the path of any image for which you have blocked the hotlinking. If your setting is working fine then you won’t see any image. If it is not working then you will see your image on the web page. If that happens then go through the setup process once again and make sure everything is working fine.
I think now you have a good idea of how to block hotlinking of images.