What is hotlinking? How do I prevent others from hotlinking my photos or videos?

Updated by Josselyn Rodriguez

Hotlinking means displaying an image on a website by linking it directly to the website hosting the image. For example, if another website owner uses a link to a picture in your website such as http://yoursite.com/picture.jpg, this is considered hotlinking. When the hotlinking website is loaded, the image is loaded from your website, which uses its bandwidth, which for some customers might be limited.

There are two methods when it comes to preventing others from hot-linking your material. The first one method is using cPanel: log in to cPanel > Click "Hotlink Protection".

Alternatively, you can do it manually by creating a .htaccess file in the 'public_html' directory that contains the following code: 

RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !^http://YOUR_IP_ADDRESS/.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://YOUR_FIRST_DOMAIN.com/.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://www.YOUR_FIRST_DOMAIN.com/.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://YOUR_SECOND_DOMAIN.com/.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://www.YOUR_SECOND_DOMAIN.com/.*$ [NC] 
RewriteRule .*.(gif|GIF|jpg|JPG)$ - [F]

For YOUR_IP_ADRESS, YOUR_FIRST_DOMAIN, and YOUR_SECOND_DOMAIN, provide your own information.

Having trouble? Contact us and our team will be happy to help.

How did we do?